Following is the HTML structure I'm using
<div id="divid">
<table>
<tr>
<td onclick="var ele = document.getElementById('inputID'); ele.click();">
<input id="inputID" onclick="event.stopPropagation();" name="nameOfElement" type="checkbox"/>
</td>
</tr>
</table>
</div>
I'm trying to set a click event on element using JQuery as follows:( for other functionality elsewhere in page)
$("#inputID").parent().on('click',function(){ // call to other functions})
this attachment leads to following error:
Uncaught Error: Syntax error, unrecognized expression: )
I have to give following functionality:
If user click on td then input element must be checked and if clicked on then click event must not be propagated to parent i.e. td as that will reverse the effect.
Also I want to Jquery's click event to execute.
Currently, only first functionality is working and event.stopPropagation() is stoping the second one.
how can I achieve both of them?
please have a look at http://jsfiddle.net/zqg0Lgbh/4/ for demo of issue.
livedeprecation (and removal).