How to add a select dropdown list placeholder with Bootstrap and HTML?

Spread the love

Sometimes, we want to add a select dropdown list placeholder with Bootstrap and HTML.

In this article, we’ll look at how to add a select dropdown list placeholder with Bootstrap and HTML.

How to add a select dropdown list placeholder with Bootstrap and HTML?

To add a select dropdown list placeholder with Bootstrap and HTML, we add a disabled option element.

For instance, we write

<select>
  <option value="" selected disabled>Please select</option>
  <option value="">A</option>
  <option value="">B</option>
  <option value="">C</option>
</select>

to make the first option element disabled to use it as a placeholder.

Conclusion

To add a select dropdown list placeholder with Bootstrap and HTML, we add a disabled option element.

Leave a Reply

Your email address will not be published. Required fields are marked *