Why does dynamically changing a checkbox not trigger a form change event?

前端 未结 2 580
刺人心
刺人心 2020-12-09 15:35

I wrote this snippet of javascript/jQuery to change a check box. http://jsfiddle.net/johnhoffman/crF93/

Javascript

$(function() {
    $(\"a\").click(         


        
2条回答
  •  天涯浪人
    2020-12-09 16:14

    This isn't surprising, but I guess you could as this to the list of non-effect in the msdn.

    • "This event is fired when the contents are committed and not while the value is changing."
    • "The onchange event does not fire when the selected option of the select object is changed programmatically."

    You could always just .click() it jsFiddle

提交回复
热议问题