Blank HTML SELECT without blank item in dropdown list

Just use disabled and/or hidden attributes:

<option selected disabled hidden style="display: none" value=""></option>
  • selected makes this option the default one.
  • disabled makes this option unclickable.
  • style="display: none" makes this option not displayed in older browsers. See: Can I Use documentation for hidden attribute.
  • hidden makes this option to don’t be displayed in the drop-down list.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)