Computer >> Computer tutorials >  >> Programming >> HTML

How to use search input type in HTML?


The search input type is used in HTML using the <input type="search">. It is used for search fields and looks like a normal text field. This can be used to add a search bar.

How to use search input type in HTML?

Example

You can try to run the following code to learn how to use search input type in HTML −

<!DOCTYPE html>
<html>
   <head>
      <title>HTML input search</title>
   </head>

   <body>
      <form action = "" method = "get">
         Search<br>
         <input type = "search" name = "search"><br>
         <input type = "submit" value = "Submit">
      </form>
   </body>
</html>