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

后端 未结 10 2034
陌清茗
陌清茗 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条回答
  •  天命终不由人
    2020-12-29 05:19

    You could add a condition to check if the contents of the search field are empty but this is all no good even with a timeout because it runs the code first then clears the box. The other problem is that the code would not react to the close button when you are editing the field

提交回复
热议问题