Trigger “onchange” event

后端 未结 4 940
日久生厌
日久生厌 2020-12-03 03:20

The \"onchange\" event is triggered only when the USER enters some value. Why isn\'t possible to fire the event when I change the value automatically via Javascript ? Is the

4条回答
  •  抹茶落季
    2020-12-03 04:12

    If you are changing the value progammatically, you already know when this occurs, what's to say you can't call your own method, (the same perhaps that is called from the actual trigger event handler) when you change the value?

    EDIT: otherwise, if you specifically need the actual Fire to occur, you can manually dispatch the event yourself too.

提交回复
热议问题