I have a strange error that I’m not sure what is not working.
I’ve got this html:
<div id="active">
<label for="slide1"></label>
<label for="slide2"></label>
<label for="slide3"></label>
<label for="slide4"></label>
<label for="slide5"></label>
</div> <!-- #active -->
and this jquery:
$("#active label").click(function () {
alert('hi');
});
Yet whenever I click on the element, the jquery does not execute. I tested in chrome to make sure I was clicking on that element, and I am. Is there a problem with the code pasted here or is my error being caused by something else?
Your code should work, assuming you have included it inside a document ready handler, and included
jquery.js