HTML DOM id ÊôÐÔ

¶¨ÒåºÍÓ÷¨

id ÊôÐÔ¿ÉÉèÖûò·µ»Ø checkbox µÄ id¡£

Óï·¨

checkboxObject.id=id

ʵÀý

ÏÂÃæµÄÀý×Ó¿ÉÊä³ö checkbox µÄ id£º

<html>
<body>

<form>
<input type="checkbox" id="check1" />
</form>

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

</body>
</html>
VUE