Home > DeveloperSection > Forums > How can I reference a html table cell td from a checkbox inside the cell using jquery?
Jeet Verma
Jeet Verma

Total Post:110

Posted on    January-20-2015 10:02 PM

 JavaScript JQuery 

 1 Reply(s)
 775  View(s)
Rate this:

I have an html table:




                  <input type="checkbox" name="myCheck">




I want to change the backcolor of the table cell when i click on the checkbox. The table cell doesn't seem to be the parent of the checkbox.

What is the correct way to get a reference to the table cell on checkbox click?


marcel ethan
marcel ethan

Total Post:105

Posted on    January-20-2015 10:37 PM

You can use currently clicked checkbox context this along with .parent() in change event to target the td element:




Don't want to miss updates? Please click the below button!

Follow MindStick