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

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

    I suppose u want to capture event when cross button is clicked Here is one solution I found I seems to be working fine(Without setTimeout())

    $('id').bind('input propertychange', function() {
    if (this.value == ""){
        doStuff()
        $input.trigger("cleared");
    }});
    

    Hope this helps!

提交回复
热议问题