Why does the javascript onchange event not fire if autocomplete is on?

前端 未结 6 1020
误落风尘
误落风尘 2020-11-27 20:26

I have a textbox with an onchange event. Why does this event not fire when the user uses the autocomplete feature to populate the textbox?

I am working with Internet

6条回答
  •  [愿得一人]
    2020-11-27 20:33

    I've encountered this annoying feature before and my solution at the time was to use the onfocus event to record the current value of the text box, and then use the onblur event to check whether the current value now matches the value saved during onfocus. For example

    
    

提交回复
热议问题