On chrome, the "search" event is fired on search inputs when user clicks the clear button.
Is there a way to capture the same event in javascript on Internet Explorer 10?
On chrome, the "search" event is fired on search inputs when user clicks the clear button.
Is there a way to capture the same event in javascript on Internet Explorer 10?
The only solution I finally found:
Why not
I realize this question has been answered, but the accepted answer did not work in our situation. IE10 did not recognize/fire the
$input.trigger("cleared");
statement.Our final solution replaced that statement with a keydown event on the ENTER key (code 13). For posterity, this is what worked in our case:
In addition, we wanted to apply this binding only to the "search" inputs, not every input on the page. Naturally, IE made this difficult as well... although we had coded
<input type="search"...>
, IE rendered them astype="text"
. That's why the jQuery selector references thetype="text"
.Cheers!
for my asp.net server control
js
ref
MSDN onchange event - tested in IE10.
... or to hide with CSS :
Use
input
instead. It works with the same behaviour under all the browsers.The
oninput
event fires withthis.value
set to an empty string. This solved the problem for me, since I want to execute the same action whether they clear the search box with the X or by backspacing. This works in IE 10 only.