我有一個按鈕可以在頁面上添加一個表單。點擊該按鈕後,如何將焦點移至表單的第一個字段?將焦點移至特定字段
簡單的例子:
HTML:
<form style="display:none;" id="newForm">
<input type="text" id="firstField">
</form>
<input type="button" id="showForm" value="add new">
的jQuery:
$("#showForm").click(function(){
$("#newForm").show();
//move focus??
});