<html>
<body>
<p>Click the button to get the text of the first child element of the select element.</p>
<select id="mySelect" size="4">
<option>Audi</option>
<option>BMW</option>
<option>Saab</option>
<option>Volvo</option>
</select>
<br><br>
<button onclick="myFunction()">Try it</button>
<p><strong>Note:</strong> The firstElementChild property is not supported in IE8 and earlier versions.</p>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("mySelect").firstElementChild.text;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_element_firstelementchild3 by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:02:18 GMT -->
</html>