<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en"
"Http://www.w3.org/TR/html4/loose.dtd" >
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title> Automatically select text </title>
<script type= "Text/javascript" >
var formutil = new Object ();
Formutil.settextboxs = function () {
var colinputs = document.getelementsbytagname_r ("input");
for (Var i=0;i<colinputs.length;i++) {
if (colinputs[i].type== "text" | | colinputs[i].type== "password") {
Colinputs[i].onfocus = function () {this.select ();};
}
}
}
Switch------------Brake to one of the input boxes-------------------------------------------------------
Formutil.tabforward = function (Otextbox) {
var oevent = window.event;
var oform = Otextbox.form;
cannot be the last element, and a carriage return event is triggered
if (oform.elements[oform.elements.length-1]!= otextbox && oevent.keycode = = 13) {
for (Var i=0;i<oform.elements.length;i++) {
if (oform.elements[i] = = Otextbox) {
for (Var j=i+1;j<oform.elements.length;j++) {
if (Oform.elements[j].type = = "Text") {
Oform.elements[j].focus ();
return;
}
}
return;
}
}
}
};
</script>
<body onload= "Formutil.settextboxs (); >
<!--<input type= "text" id= "target01" onkeydown= "if (event.keycode==32) return false"/>-->
<form name= "Form1" >
<table>
<tr><td><input type= "checkbox"/> title 1</td><td><input type= "text" id= "text_01" style = "Text-align:right" value= "123456789" onkeyup= "return Formutil.tabforward (this);" /></td><td><input type= "text" id= "text_02" style= "Text-align:right" value= "123456789" onKeyUp= " Return Formutil.tabforward (this); " /></td></tr>
<tr><td><input type= "checkbox"/> title 2</td><td><input type= "text" id= "text_03" style = "Text-align:right" value= "123456789" onkeyup= "return Formutil.tabforward (this);" /></td><td><input type= "text" id= "text_04" style= "Text-align:right" value= "123456789" onKeyUp= " Return Formutil.tabforward (this); " /></td></tr>
<tr><td><input type= "checkbox"/> title 3</td><td><input type= "text" id= "text_05" style = "Text-align:right" value= "123456789" onkeyup= "return Formutil.tabforward (this);" /></td><td><input type= "text" id= "text_06" style= "Text-align:right" value= "123456789" onKeyUp= " Return Formutil.tabforward (this); " /></td></tr>
</table>
</form>
</body>
An example of an essay-js written as an object