w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it



option ... ⁄option, optional element ⁄occurrences

The option element is optional.
The option can be added multiple times in page within: select, optgroup, datalist

Examples:

Valid Syntax 1
option element absent
1
2
3
4
5
6
7
8
9
<!doctype html>
<html>
<head>
<title>...</title>
</head>
<body>

</body>
</html>
Valid Syntax 2
multiple option elements present
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!doctype html>
<html>
<head>
<title>...</title>
</head>
<body>

<datalist>
<option>...</option>
<option>...</option>
</datalist>

<select>
<option>...</option>
<option>...</option>
</select>

<select>
<optgroup>
<option>...</option>
<option>...</option>
</optgroup>
</select>

</body>
</html>
option intro option browser display option parents - children option(s) selected vs pre-selectedoption syntaxoption disabled attributeoption selected attribute