I have a jquery function that binds all tr's with the class item to a click function that will redirect to another page. inside this tr though is a checkbox. How can i allow this checkbox to function correctly instead of acting on the tr's click function?
Asked
Active
Viewed 42 times
3 Answers
1
You might want to post code, but briefly, I would add a separate click function just for the password, and in it, call event.stopPropagation()
.

Jacob Mattison
- 50,258
- 9
- 107
- 126
0
You can also bind it to a click function which stops the even from being passed on via return false.
$('#checkbox').click(function() { return false; })
Another way would be to position your checkbox above the tr. This would however not size the tr with the checkbox in it (as you made it independent). This could be done with position:absolute, or you could also try z-index (although I’m not sure this will work with events).

Kissaki
- 8,810
- 5
- 40
- 42