Checking button click for particular class
<pre><code>$("div#buttonContainer ul li").live("click",function(){


if($(this).hasClass('selected')){
    alert('selected');
}

});


&lt;div id="buttonContainer"&gt;
&lt;ul&gt;
&lt;li class="selected"&gt;&lt;/li&gt;
&lt;li&gt;&lt;/li&gt;
&lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
</code></pre>

<p>I have the click handler that applies to all the li tags, but I want specific function to execute when the li has the selected class. The javascript above pops up the alert on any li clicked. I'm not sure what I'm doing wrong, perhaps I'm not targeting the specific li properly.</p>

<p>EDIT:</p>

<p>I must use jquery 1.3 techniques as I can't upgrade.</p>
