How can I disabled/enable multiple buttons using jQuery
<p>I'm using the following script to move a <code>&lt;tr&gt;</code> from any position in a table to the top of that table. This happens after an ajax form is submitted. The form's--not the button's--class is "top"</p>

<pre><code>$(".top").click(function() {
    var thisRow = $(this).parent().parent();
    var firstRow = thisRow.parent().find("tr:first").not(thisRow);
    thisRow.insertBefore(firstRow);
});
</code></pre>

<p>Once an item reaches the top of the table, I would like to disable the <code>Send Item To Top</code> button. The problem becomes complicated because there are two other buttons in each <code>&lt;tr&gt;</code>: <code>Move Item Up By One</code> and <code>Move Item Down By One</code> (both ajax, too)</p>

<p>Once a <code>&lt;tr&gt;</code> is moved to the top, I would like to disable the <code>Move Item Up By One</code> along with the <code>Send Item To Top</code> button. In addition, I would like to re-enable both of them when the <code>Move Item Down By One</code> is clicked.</p>

<p>The following script is being used to swap the <code>&lt;tr&gt;</code>'s positions when it's moved up/down by one.</p>

<p><strong>NOTE: I can NOT assign any of my buttons an id or a class because their forms are dynamically generated. I can only assign the form an ID or a class.</strong></p>

<pre><code>// Move item down/up
$(".up,.down").click(function(){
    var row = $(this).parents("tr:first");
    if ($(this).is(".up")) {
        row.insertBefore(row.prev());
    } else {
        row.insertAfter(row.next());
    }
});
</code></pre>

<p>Here is the HTML:</p>

<pre><code>&lt;tr id="item_168" class="element168"&gt;
    &lt;td&gt;&lt;form action=".." class="top..." method="post" onsubmit="..."&gt;&lt;input onclick="" type="submit" value="&amp;uarr;" /&gt;&lt;/form&gt;&lt;/td&gt;
    &lt;td class="action"&gt;&lt;form action="up..." class="up" method="post" onsubmit="..."&gt;&lt;input onclick="" type="submit" value="&amp;uarr;" /&gt;&lt;/form&gt;&lt;/td&gt;
    &lt;td class="action"&gt;&lt;form action="down..." class="down" method="post" onsubmit="..." title="Move one"&gt;&lt;input onclick="" type="submit" value="&amp;darr;" /&gt;&lt;/form&gt;&lt;/td&gt;
&lt;/tr&gt;
</code></pre>
