HTML DOM alt ÊôÐÔ

¶¨ÒåºÍÓ÷¨

alt ÊôÐÔ¿ÉÉèÖûò·µ»ØÔÚä¯ÀÀÆ÷²»Ö§³ÖÎı¾ÓòʱÏÔʾµÄÌæ´úÎı¾¡£

Óï·¨

textObject.alt=alternate_text

ʵÀý

ÏÂÃæµÄÀý×Ó¿É·µ»ØÎı¾ÓòµÄ alt Îı¾£º

<html>
<body>

<form>
Email: <input type="text" alt="Email input field" id="email" />
</form>

<p>The alt text for the text field is:
<script type="text/javascript">
x=document.getElementById('email');
document.write(x.alt);
</script></p>

</body>
</html>
VUE