w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it



datalist nested within elements, elements nested within datalist

Classified as: flow content, phrasing content

Parents, datalist

Children, datalist

Examples: datalist parents, datalist children

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

<datalist>

</datalist>

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

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

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

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

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

<datalist>
<section>
...
</section>
</datalist>

</body>
</html>

Syntax 1: Valid, datalist nested within body: allowed
Syntax 2: Valid, option elements nested within datalist: allowed
Syntax 3: Invalid, options + other elements (part of phrasing content) nested within datalist: not allowed: it's either option elements either phrasing elements
Syntax 4: Invalid, datalist nested within head: not allowed; section nested within datalist: not allowed

datalist intro datalist browser display datalist syntax