简体   繁体   中英

Using jquery event on close button in search box

The question is whether I can call a function on event of clicking close button in search box. What I'm using is <input type='search'>

While typing, close button appears clicking on which I want to call a particular function. Is it possible? I tried to Google it but couldn't get much out of it. Can anyone help?

You can use jQuery .on('search', function() { ... }) to handle this event. Here is a fiddle example: http://jsfiddle.net/7EynL/

See this question for additional details.

Use ' search ' event

$('input[type="search"]').on('search', function(event) {
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM