HTML DOM defaultValue ÊôÐÔ

¶¨ÒåºÍÓ÷¨

defaultValue ÊôÐÔ¿ÉÉèÖûò·µ»ØÎı¾ÓòµÄĬÈÏÖµ¡£

×¢ÊÍ£º¸ÃĬÈÏÖµÊǹ涨ÓÚ HTML "value" ÊôÐÔµÄÖµ¡£

Óï·¨

textObject.defaultValue=somevalue

ʵÀý

ÏÂÃæµÄÀý×Ó¿É»ñµÃ¸ÃÎı¾ÓòµÄĬÈÏÎı¾£º

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

<form>
<input type="text" id="text1" value="Hello World!" />
<input type="button" id="button1" onclick="alertValue()" 
value="Show default value" />
</form>

</body>
</html>
VUE