Phiên bản đầy đủ: jsB@nk » Biểu mẫu » Focus cho field đầu tiên
URL: https://www.javascriptbank.com/first-form-field.html
Hiệu ứng sẽ tạo focus cho trường đầu tiên của biểu mẫu khi trang web vừa tải xong.
Phiên bản đầy đủ: jsB@nk » Biểu mẫu » Focus cho field đầu tiên
URL: https://www.javascriptbank.com/first-form-field.html
<SCRIPT LANGUAGE="JavaScript">// Wayne Nolting ([email protected])<!-- Beginfunction toForm() {document.form.field1.focus();// Replace field1 in the script with the field name of which you want to place the focus.}// End --></script><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<BODY onLoad="toForm()"><FORM NAME="form" METHOD="POST" ACTION="#"><SELECT NAME="field1" SIZE="1"><OPTION VALUE="one">Field 1<OPTION VALUE="two">also field1</SELECT><BR><INPUT TYPE="TEXT" NAME="field2" SIZE="10"> Field 2<BR><INPUT TYPE="TEXT" NAME="field3" SIZE="10"> Field 3<BR><BR><INPUT TYPE="SUBMIT" NAME="submit" VALUE="Submit"> <INPUT TYPE="RESET" onclick="toForm();"></FORM></BODY><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->