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

后端 未结 10 2046
陌清茗
陌清茗 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:26

    I don't know that this is the correct answer, but the click event handler is called when the user clears the input using the X button.

    $('input[type="search"]').click(function(event) {
        // This code runs anytime a user clicks on the input,
        // including when they clear it using the X button.
    })
    

提交回复
热议问题