How do you detect the clearing of a “search” HTML5 input?

Actually, there is a “search” event that is fired whenever the user searches, or when the user clicks the “x”. This is especially useful because it understands the “incremental” attribute.

Now, having said that, I’m not sure if you can tell the difference between clicking the “x” and searching, unless you use an “onclick” hack. Either way, hopefully this helps.

Dottoro web reference

Leave a Comment