x
 
<!DOCTYPE html>
<html>
<body>
<h1>Element 对象</h1>
<h2>childNodes 属性</h2>
<select id="mySelect" style="width:100px" size="5"><option>Audi</option><option>BMW</option><option>Saab</option><option>Volvo</option></select>
<p>select 元素的第三个子节点的文本是:</p>
<p id="demo"></p>
<script>
let text = document.getElementById("mySelect").childNodes[2].text;
document.getElementById("demo").innerHTML = text;
</script>
</body>
</html>