javascript - Couldn't access input with jquery selector -


I'm trying to capture the click event on the checkbox Xbath is followed by the firebug for the element as The starting table for my JSP (i.e., the table is inserted) is the table.

  / html / body / div [1] / div / div / div [2] / div / div [2] / div [1] / div / div [2] / table / TDI / tr [1] / TD [8] / center / input  

and html tag

  & lt; Input type = "checkbox" name = "myCheckbox" class = "rmvChkBox" value = "something" />  

I think I am not able to point out the element due to being deeper than its various elements. I tried several combinations, some of them are

  $ ('. RmvChkBox'). Click (function () {...} $ ('# myTable input [type = checkbox]'). Click (function () {...}); $ ('# myTable tr td input [type = checkbox ] '). Click (function () {...});  

You can try one more option:

  $ ('Input name ["rmvChkBox"]'). Click (function () {...});  

This name will catch all inputs with "rmvChkBox." If this does not work, then it is possible that this element is dynamically added to the domain? If so, your click is not yet registered because the element does not exist. If so, you can use an "on" event or "live" event if you have an older version. / P>

< / Html>

Comments