HTML <option> Attributes

HTML <option> disabled Attribute A drop-down list with one disabled option: <select> <option value=”volvo” disabled>Volvo</option> <option value=”saab”>Saab</option> <option value=”vw”>VW</option> <option value=”audi”>Audi</option> </select> Try it Yourself » Definition and Usage The disabled attribute is a boolean attribute. When present, it specifies that an option should be disabled. A disabled option is unusable and un-clickable. The disabled attribute can be set to keep a […]

HTML <option> Tag

Example A drop-down list with four options: <select> <option value=”volvo”>Volvo</option> <option value=”saab”>Saab</option> <option value=”opel”>Opel</option> <option value=”audi”>Audi</option> </select> Try it Yourself » Definition and Usage The <option> tag defines an option in a select list. <option> elements go inside a <select> or <datalist> element. Browser Support Element <option> Yes Yes Yes Yes Yes Tips and Notes Note: The <option> tag can be used without any […]

HTML DOM Caption Object

Caption Object The Caption object represents an HTML <caption> element. Access a Caption Object You can access a <caption> element by using getElementById(): Example var x = document.getElementById(“myCaption”); Try it Yourself » Create a Caption Object You can create a <caption> element by using the document.createElement() method: Example var x = document.createElement(“CAPTION”); Try it Yourself » Tip: You […]