Hijacking onchange event without interfering with original function

前端 未结 3 1753
伪装坚强ぢ
伪装坚强ぢ 2021-01-03 12:37

I\'m writing on a library I want to include on different pages who might already use the onchange event - is there any way to attach my event to onchange<

3条回答
  •  半阙折子戏
    2021-01-03 13:03

    Using jQuery's .change() function to assign an onchange handler will not override existing onchange events (or other jQuery-assigned handlers). See a working demonstration here: http://jsfiddle.net/nrabinowitz/EyKdm/

提交回复
热议问题