HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
The onsearch attribute fires when a user presses the "ENTER" key or clicks the "x" button in an <input> element with type="search"."
The onsearch
attribute fires when a user presses the "ENTER" key or clicks the
"x" button in an <input> element with type="search".
The onsearch
attribute is part of the Event Attributes, and can be used on the following element:
Elements | Event |
---|---|
<input type="search"> | onsearch |
Execute a JavaScript when submitting a search:
<input type="search" onsearch="myFunction()">
The numbers in the table specify the first browser version that fully supports the event attribute.
Event Attribute | |||||
---|---|---|---|---|---|
onsearch | Yes | Not supported | Not supported | Yes | 15.0 |