0

Possible Duplicate:
trigger onchange event manually

I have a checkbox in a form that I want to set to checked. That's easy:

var checkbox = document.getElementById("mycheckbox");
checkbox.checked = true;

But I want to do this so that the onChange listeners get called. How do I do this?

Community
  • 1
  • 1
Jason S
  • 184,598
  • 164
  • 608
  • 970
  • Is [this](http://stackoverflow.com/questions/2856513/trigger-onchange-event-manually) a duplicate? – lonesomeday Oct 03 '12 at 19:15
  • Evidently yes. I figured there was, but I couldn't find one. Thanks! – Jason S Oct 03 '12 at 19:19
  • Better answer is actually for this question http://stackoverflow.com/questions/4158847/is-there-a-way-to-simulate-key-presses-or-a-click-with-javascript – Jason S Oct 03 '12 at 19:22

0 Answers0