我有一個div,我輸入一個搜索查詢:如何在div中的字段上自動設置焦點?
<div id="search">
<form method="get" action="http://www.bing.com/search">
<input type="text" name="q" size="31" maxlength="255" value="" />
<input type="submit" value="Search" />
</form>
</div>
我怎麼能自動將焦點設置在頁面加載時?