HTML DOM value ÊôÐÔ

¶¨ÒåºÍÓ÷¨

value ÊôÐÔ¿ÉÉèÖûò·µ»ØÒþ²ØÊäÈëÓòµÄ value ÊôÐÔµÄÖµ¡£

value ÊôÐÔ¶¨ÒåÁ˸ÃÒþ²ØÓòµÄĬÈÏÖµ¡£

Óï·¨

hiddenObject.value

ʵÀý

ÏÂÃæµÄÀý×Ó¿ÉÈ¡µÃ¸ÃÒþ²ØÓòµÄÖµ£º

<html>
<head>
<script type="text/javascript">
function alertValue()
  {
  alert(document.getElementById("hidden1").value)
  }
</script>
</head>
<body>

<form>
<input type="hidden" id="hidden1" value="W3School" />
<input type="button" id="button1" onclick="alertValue()" 
value="Show value of the hidden field" />
</form>

</body>
</html>
VUE