HTML 5 <input> autofocus ÊôÐÔ
ʵÀý
Îı¾ÊäÈë×ֶα»ÉèÖÃΪµ±Ò³Ãæ¼ÓÔØÊ±»ñµÃ½¹µã£º
<form action="demo_form.asp">
First name:<input type="text" name="fname" autofocus="autofocus"
/><br />
Last name: <input type="text" name="lname" /><br />
<input type="submit" />
</form>
¶¨ÒåºÍÓ÷¨
autofocus ÊôÐԹ涨µ±Ò³Ãæ¼ÓÔØÊ± input ÔªËØÓ¦¸Ã×Ô¶¯»ñµÃ½¹µã¡£
Èç¹ûʹÓøÃÊôÐÔ£¬Ôò input ÔªËØ»á»ñµÃ½¹µã¡£
HTML 4.01 Óë HTML 5 Ö®¼äµÄ²îÒì
autofocus ÊôÐÔÊÇ HTML5 ÖеÄÐÂÊôÐÔ¡£
Óï·¨
<input autofocus="autofocus">