HTML DOM alt ÊôÐÔ

¶¨ÒåºÍÓ÷¨

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

Óï·¨

radioObject.alt=alternate_text

ʵÀý

ÏÂÃæµÄÀý×Ó¿É·µ»Øµ¥Ñ¡°´Å¥µÄ alt Îı¾£º

<html>
<body>

<form>
Male: <input id="male" alt="male" type="radio"
name="Sex" value="Male" />
<br />
Female: <input id="female" alt="female" type="radio"
name="Sex" value="Female" />
</form>

<p>The alt text for the radio buttons are:
<script type="text/javascript">
document.write(document.getElementById('male').alt);
document.write(" and ");
document.write(document.getElementById('female').alt);
</script></p>

</body>
</html>
VUE