p210_current_field.htm

来自「javascript source code part2」· HTM 代码 · 共 15 行

HTM
15
字号
 <HTML><BODY><SCRIPT>
function defocus()
{
  window.document.forms[0].two.focus();           // go to field 'two'.
}
</SCRIPT><FORM>
  <! this first field is the one that is set to be workably read-only >
  <INPUT NAME="one" TYPE="text" ONFOCUS="setTimeout('defocus()',1)">
  <! this field's only purpose is to have somewhere else to put the focus >
  <INPUT NAME="two" TYPE="text">
<SCRIPT>
// to start with, put the focus in element 'two':
document.forms[0].two.focus();</SCRIPT>
</FORM></BODY></HTML>
		

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?