I have a checkbox:
<input id="abcd" name="abcd" type="checkbox" onclick="doSomething(this, 'otherparams');">
Now, I have some other code, that could do the following:
document.getElementByID("abcd").checked=true;
I want doSomething
to fire even when I change the state of the checkbox programmatically. (Am ready to use anyone of onchange/onclick
in the checkbox input)
Here is what I am trying: http://jsfiddle.net/hfovh2xm/6/
To give some context: Its a large piece of code with multiple interacting modules (a module that I do not want to edit could set the checkbox value, I would like to detect that change in my module).