Are there any events available for the reset option for input search?

后端 未结 10 2032
陌清茗
陌清茗 2020-12-29 05:09

In HTML5 there is a new input type, \'search\'. On most browser it\'s just remain to a simple \'text\' input, but for webkit based browsers, it adds a little cross to reset

10条回答
  •  梦毁少年i
    2020-12-29 05:35

    In my testing with MS Edge, it didn't fire any of these events. I tried input, change, click, and search and they weren't triggered when you click the X. I even tried directly setting input.onchange, input.onclick, etc - still nothing.

    The only events that seemed to fire were mousedown and mouseup, but the input's value hadn't been cleared yet so I had to use a setTimeout after detecting the event.

提交回复
热议问题