I am attempting to detect the click event on a checkbox. The Xpath for the element provided by firebug is as follows, starting with a table tag in my JSP (i.e. the table is within a div).
/html/body/div[1]/div/div/div[2]/div/div[2]/div[1]/div/div[2]/table/tbody/tr[1]/td[8]/center/input
The corresponding html code is
<input type="checkbox" name="myCheckbox" class="rmvChkBox" value="something"/>
Because it is nested deep within multiple elements, I am having trouble targeting the specific element. I have tried various combinations including:
$('.rmvChkBox').click(function() { ... }
$('#myTable input[type=checkbox]').click(function() { ... });
$('#myTable tr td input[type=checkbox]').click(function() { ... });