mirror of
https://github.com/classilla/tenfourfox.git
synced 2024-11-01 06:06:32 +00:00
19 lines
458 B
HTML
19 lines
458 B
HTML
|
<!DOCTYPE html>
|
||
|
<body>
|
||
|
<html>
|
||
|
<select id="test" size="8">
|
||
|
</select>
|
||
|
<script>
|
||
|
var optgroup = document.createElement("optgroup");
|
||
|
optgroup.setAttribute('label', 'An optgroup');
|
||
|
var option = document.createElement("option");
|
||
|
var optionText = document.createTextNode("An option");
|
||
|
option.appendChild(optionText);
|
||
|
var select = document.getElementById("test");
|
||
|
|
||
|
optgroup.appendChild(option);
|
||
|
select.appendChild(optgroup);
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|