w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it



option ... ⁄option syntax

Syntax option

Examples option syntax

Valid Syntax 1a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<!doctype html>
<html>
<head>
<title>...</title>
</head>
<body>

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

</body>
</html>
Valid Syntax 1b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!doctype html>
<html>
<head>
<title>...</title>
</head>
<body>

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

</body>
</html>
Valid Syntax 2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<!doctype html>
<html>
<head>
<title>...</title>
</head>
<body>

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

</body>
</html>

Video demonstration option element, syntax

HTML5 option element, syntax Tutorial

min video details
00:06 video tutorial: option element, syntax
00:10 adding the option element in page
00:15 the option element has:

- a start tag: <option>
- and an end tag: <⁄option>
00:20 the end tag: <⁄option> may be omitted IF:
00:20 1. option element is followed next by another option element
00:29 2. option element is followed next by optgroup element
00:35 3. after option element, there's no more content inside the parent element, select
option intro option optional, occurrences option browser display option parents - children option(s) selected vs pre-selectedoption disabled attributeoption selected attribute