Making checkbox when container is clicked

Ha4x0r

New Member
I have a div element containing a checkbox, when I click the div I want the checkbox to toggle.I did this by assigning the following code to $(#div).click:\[code\]$(this).find(":checkbox").prop("checked", !$(this).find(":checkbox").prop("checked"));\[/code\]The problem now is that if the checkbox itself is clicked, the code above is still executed and thus the checkbox stays in the same state. How would I fix this?
 
Back
Top