I'm using pure javascript. There's a checkbox with a function attached to it when "onchange" event occurs.
I want to call that function, when I check and uncheck it from the javascript code.
It gets checked and unchecked but that function is not called unless I do it from manually by keyboard arrow keys.
Is there any way to make that function get called ?
HTML DOM :
<input type="checkbox" onchange="hello();" id="myCheckBox">
Javascript:
document.getElementById("myCheckBox").checked = true;