How to use search input type in HTML?

HTMLWeb DevelopmentFront End Technology

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.

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>
raja
Published on 23-Jan-2018 10:46:06
Advertisements