jquery trigger on certain item state conditions
<p>Looking to trigger an action but not sure what the best way to go about it is. Still picking up jquery / javascript, so thought I'd ask for advice before hacking something out. </p>

<p>Have a unordered list of items with a toggle(two buttons) on each item. Once they have all been toggled, if they're all A do something, if at least one of them is B do something different.</p>

<p>Looking to not bog down the interface speed so looking for a speedy way. I guess I would have to do it on every button press regardless? Was thinking i could just bind it to the last item, but that may not always be the last one processed. </p>

<p>was also thinking I could set something like a string with "ABC" and after each item is updated it removes it's particular letter from the string then executes a function if the string is empty. </p>

<p>Am I over thinking? From what I've read you need to be careful with how you select elements with jquery because some things like selecting by ID are much speedier than others. </p>

<p>Here's what the HTML looks like:</p>

<pre><code>&lt;li id="1"&gt; 
    &lt;h3 class="item_id"&gt;#17A&lt;/h3&gt; 
    &lt;div class="itemstatus"&gt;
        &lt;span class="itemstate"&gt;Pending&lt;/span&gt;
        &lt;span class="statereason"&gt;&lt;/span&gt;
    &lt;/div&gt;
    &lt;p&gt;cheese&lt;/p&gt;
    &lt;span class="btns"&gt;
        &lt;a href="#" class="greenButton" id="approve"&gt;True&lt;/a&gt; 
        &lt;a href="#" class="redButton" id="decline"&gt;False&lt;/a&gt;
    &lt;/span&gt; 
&lt;/li&gt;
</code></pre>

<p>status of each item is presently determined via the itemstate span contents</p>
