HTML DOM form ÊôÐÔ

¶¨ÒåºÍÓ÷¨

id ÊôÐÔ¿ÉÉèÖûò·µ»ØÏÂÀ­ÁбíµÄ id¡£

Óï·¨

selectObject.id=id

ʵÀý

ÏÂÃæµÄÀý×Ó¿É·µ»ØÏÂÀ­ÁбíµÄ id£º

<html>
<body>

<form id="myForm">
<select id="mySelect">
  <option>Apple</option>
  <option>Pear</option>
  <option>Banana</option>
  <option>Orange</option>
</select>
</form>

<p>The id of the dropdown list is:
<script type="text/javascript">
document.write(document.getElementById("mySelect").id)
</script>
</p>

</body>
</html>
VUE