My code is:
<select>
<option value="" disabled>seleccione la marca</option>
<option value="saab">Saab</option>
<option value="vw">VW</option>
<option value="audi">Audi</option>
</select>
How do I make it appear in the select seleccione la marca
, but not be selectable?
I tried disabled
but it doesn't show up.
Try this code by changing your
option
like so:This is the result:
Use the property
selected
as itdisabled
is actually to disable the option:or you can perform a combination of both properties:
This is the definition of the properties:
you put
select
the attributerequired
andoption
"select the brand" you remove the attributedisabled