HTML onsearch Event Attribute

The HTML onsearch event attribute is triggered when a user hit "Enter" key in an HTML input element with type="text" in an HTML document.

Syntax

Following is the syntax ?

Let us see an example of HTML onsearch event Attribute ?

Example






HTML onsearch Event Attribute Demo

Enter what you want to search and then hit "Enter" key

Output

Enter your search text in the search field and then hit "Enter" key to observe how onsearch event attribute works.

Updated on: 2026-03-11T22:50:45+05:30

151 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements