Here's my code:
HTML:
<ul id="more-items">
<li><label class="button">hi</label></li>
<li><label class="button">hi</label></li>
<li><label class="button">hi</label></li>
</ul>
Javascript:
$('ul#more-items label.button').live('click', function()
{
alert(1);
});
Clicking on the labels doesn't cause the alert() to fire. The .live() bind seems to have no affect on the label element...
If I change it to use .click() or even .bind(), it works perfectly. Is there any reason why .live() isn't working? Is there a way to fix this?
The reason I'm using .live() is because ul#more-items
will be readded to the page multiple times and I don't want to have to fire off a function each time that happens to rebind the click.