Languages
[Edit]
EN

HTML - create select element placeholder

0 points
Created by:
user4838
698

In this article, we would like to show you how to create a select element placeholder in HTML.

Quick solution:

 

Practical example

Edit

In this section, we present how to create a select box placeholder using selected and disabled attributes of an option element at once.

Note:

The placeholder's text will be visible until the user selects one of the options, then it can't be set back.

References

Edit
  1. <option> - selected | MDN
  2. <option> - disabled | MDN

Alternative titles

  1. HTML - set disabled select box option as default
  2. HTML - create select box placeholder
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join