``` --- ## Definition and Usage The"> ``` --- ## Definition and Usage The" />
Easy Tutorial
❮ Prop Style Transformstyle Prop Url Required ❯

onsearch Event

Event Object

Example

Execute JavaScript when a search is submitted:

<input type="search" 
    onsearch="myFunction()">

Definition and Usage

The onsearch event is triggered when the user presses the "ENTER" key or clicks the "x(search)" button of an <input> element with type="search".


Browser Support

The numbers in the table specify the first browser version that supports the event.

Event
onsearch Yes Not supported Not supported Yes 15.0

Syntax

In HTML:

In JavaScript:

In JavaScript, using the addEventListener() method:

Note: The addEventListener() method is not supported in Internet Explorer 8 and earlier versions.


Technical Details

Bubbles: Yes
Cancelable: No
--- ---
Event type: Event
--- ---
Supported HTML tags: <input type="search">
--- ---

Event Object

❮ Prop Style Transformstyle Prop Url Required ❯