onsearch event | search event
Occurs when the user presses the ENTER key or clicks the 'Erase search text' button (x) in an input:search field.
If the INCREMENTAL attribute of a input:search element is set to 'true', then changing the contents of the input:search field also causes the onsearch event to be fired.
How to register:
|object.onsearch = handler;|
|object.addEventListener ("search", handler, useCapture);|
You can find the related objects in the Supported by objects section below.
The event object is accessible to all event handlers in all browsers. The properties of the event object contain additional information about the current event. To get further details about these properties and the possible event handler registration methods, please see the page for the event object.
Actions that invoke the onsearch event:
- Pressing the ENTER key or clicking the 'Erase search text' button in a search control.
Example HTML code 1:
This example illustrates the use of the onsearch event:
Did you find this example helpful?
User Contributed Comments