HTML DOM alt ÊôÐÔ
¶¨ÒåºÍÓ÷¨
alt ÊôÐÔ¿ÉÉèÖûò·µ»Øä¯ÀÀÆ÷²»Ö§³Ö checkbox ʱÏÔʾµÄÌæ´úÎı¾¡£
Óï·¨
checkboxObject.alt=alternate_text
ʵÀý
ÏÂÃæµÄÀý×Ó·µ»ØÁË checkbox µÄÌæ´úÎı¾£º
<html> <body> <form> I have a bike: <input id="bike" alt="bike" type="checkbox" name="Bike" /> <br /> I have a car: <input id="car" alt="car" type="checkbox" name="Car" /> </form> <p>The alt text for the checkboxes are: <script type="text/javascript"> document.write(document.getElementById('bike').alt); document.write(" and "); document.write(document.getElementById('car').alt); </script></p> </body> </html>