<html>
<head>
</head>
<body>
<form>
<select id="mySelect">
<option>Apple</option>
<option>Pear</option>
<option>Banana</option>
<option>Orange</option>
</select>
</form>
<p>There are <span id="demo">0</span> options in the list.</p>
<script>
document.getElementById("demo").innerHTML =
document.getElementById("mySelect").length;
</script>
</body>
<!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=try_dom_select_length by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:40:21 GMT -->
</html>