Difference between revisions of "Select Option and Optgroup Elements"

From Level Access Web Labs
Jump to navigation Jump to search
(Listobx)
Line 43: Line 43:
 
   </optgroup>
 
   </optgroup>
 
</select>
 
</select>
 +
</html>
 +
 +
== Select with over 20 options ==
 +
<html>
 +
<label for="selectable">
 +
How many delicious toppings would you like on your pizza?
 +
</label>
 +
<select id="selectable">
 +
<option>0</option>
 +
</select>
 +
<script type="text/javascript">
 +
var o;
 +
for (var i = 0; i < 200; i++) {
 +
o = document.createElement("option");
 +
o.text = i;
 +
document.getElementById("selectable").add(o);
 +
}
 +
</script>
 
</html>
 
</html>
  
 
[[Category:Elements]]
 
[[Category:Elements]]

Revision as of 23:32, 31 March 2016

Combobox

Listbox

Multi-select

Select with Optgroup

Select with over 20 options