Phiên bản đầy đủ: jsB@nk » Biểu mẫu » Focus cho field
URL: https://www.javascriptbank.com/field-focus.html
Hiệu ứng tạo focus cho trường nào đó ở bất kì trên biểu mẫu khi vừa tải trang web xong.
Phiên bản đầy đủ: jsB@nk » Biểu mẫu » Focus cho field
URL: https://www.javascriptbank.com/field-focus.html
<SCRIPT LANGUAGE="JavaScript">// John Munn ([email protected])<!-- Begin function putFocus(formInst, elementInst) { if (document.forms.length > 0) { document.forms[formInst].elements[elementInst].focus(); } }// The second number in the "onLoad" command in the body// tag determines the form's focus. Counting starts with '0'// End --></script><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<BODY onLoad="putFocus(0,1);"><form method="post" name="bogus" id="bogus-form"><input type="text" name="bogus_field0" id="bogus_field0" size="20" maxlength="12"><br><input type="text" name="bogus_field1" id="bogus_field0" size="20" maxlength="12" value="Form focus is here!"><br><input type="text" name="bogus_field2" id="bogus_field0" size="20" maxlength="12"></form><BODY/><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->