DEV Community

Cover image for How to make search bar and suggestion using only html.
Manohar Anand
Manohar Anand

Posted on

How to make search bar and suggestion using only html.

Hi! What's up this is your boy Manohar Anand From the house of Manoarya.

In this article we are going to assist you with How to make search bar and suggestion using only html for free.

Are you Guys exited? Let me know in the comment. Ask Questions and give suggestions.

Let's Started.

See Demo

Fist of all you need to create a file and name it whatever you want.

Now Copy the following codes.

Add HTML Code


            <!DOCTYPE html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <meta name="viewport"
  content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <title>Snap scrolling Effect</title>
</head>
<body>
  <div class="container">
    <input type="text" list="suggestions" placeholder="Search course" />
    <datalist id="suggestions">
      <option>Manoarya</option>
      <option>React native course</option>
      <option>React course</option>
      <option>Javascript course</option>
      <option>CSS course</option>
      <option>HTML course</option>
    </optgroup>
  </datalist>
</div>
</body>

Enter fullscreen mode Exit fullscreen mode

Add CSS Code


    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    .container {
      height: 100vh;
      width: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: column;
      background: #d3d3d3;
    }
    .container input {
      padding: 10px 20px;
      background: white;
      border: none;
      outline: none;
      border-radius: 5px;
    }


Enter fullscreen mode Exit fullscreen mode

That all for this post. I hope you love this project. please share your thoughts and suggestions in comment below.

Thank you For Visiting. By see You soon.

Image of Bright Data

Feed Your Models Real-Time Data – Enhance your AI with up-to-the-minute data.

Utilize our live data feeds for dynamic model training, ensuring your AI systems are always ahead.

Access Real-Time Data

Top comments (0)

Image of AssemblyAI

Automatic Speech Recognition with AssemblyAI

Experience near-human accuracy, low-latency performance, and advanced Speech AI capabilities with AssemblyAI's Speech-to-Text API. Sign up today and get $50 in API credit. No credit card required.

Try the API

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay