代码示例:(标识:jsck_element_lastelementchild_3)
<!DOCTYPE html>
<html>
<body>

<h1>Element 对象</h1>

<h2>lastElementChild 属性</h2>

<select id="mySelect" size="5">
  <option>Audi</option>
  <option>BMW</option>
  <option>Saab</option>
  <option>Volvo</option>
  </select>
<br><br>

<p>select 元素的最后一个子元素的文本是:</p>
<p id="demo"></p>

<script>
const element = document.getElementById("mySelect");
document.getElementById("demo").innerHTML = element.lastElementChild.text;
</script>

</body>
</html>
运行结果: