Javatpoint Logo
Javatpoint Logo

HTML Selected Attribute

The Selected is an attribute of the <option> element, which is used to define the default selection in a dropdown-list.

When any option uses this attribute, then that option should be pre-selected and displayed first, when the web page loads.

Syntax

Example: The following example uses the Selected attribute in the <option> tag with the Jaguar value.

Test it Now

Output:

HTML Selected Attribute

Example 2: The following example uses the Selected attribute in the <option> tag with the Pomegranate value.

Test it Now

Output:

HTML Selected Attribute

Browser Support

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<selected>YesYesYesYesYes

Next TopicSimple HTML Pages




Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA