Get class name from element, and select all elements with the same class
<pre><code>$('.classToClick').live("click", function () {
    $(this).attr('disabled', 'disabled');
    $(this).val("lol");
    $.post('post.php', {
        string: "lalala"
    }, function (data) {
        $(this).removeAttr('disabled');
    });
})
</code></pre>

<p>This code doesn't work, because in post we use <code>$(this)</code>. When we change it to <code>.classToClick</code>, it works. </p>

<p>How can we get the class of the element clicked so that we could use it like this?</p>

<pre><code>$('.classToClick').live("click", function () {
    var className = $(this).name;
    $(this).attr('disabled', 'disabled');
    $(this).val("lol");
    $.post('post.php', {
        string: "lalala"
    }, function (data) {
        $(className).removeAttr('disabled');
    });
})
</code></pre>

<p>Is it possible to do something similar?</p>
