HTML DOM name ÊôÐÔ
¶¨ÒåºÍÓ÷¨
name ÊôÐÔ¿ÉÉèÖûò·µ»ØÏÂÀÁбíµÄÃû³Æ¡£
Óï·¨
selectObject.name=name
ʵÀý
ÏÂÃæµÄÀý×Ó¿ÉÌáʾÏÂÀÁбíµÄÃû³Æ£º
<html>
<head>
<script type="text/javascript">
function getName()
{
alert(document.getElementById("mySelect").name
)
}
</script>
</head>
<body>
<form>
<select name="mySelect" id="mySelect">
<option>Apple</option>
<option>Pear</option>
<option>Banana</option>
<option>Orange</option>
</select>
<input type="button" onclick="getName()"
value="Alert name">
</form>
</body>
</html>