Function Man (Name, SEX, AGE) {var len = man.Arguments.Length; if (len == 3) {this.name = name; this.sex = sex;} else alert (" The parameter passes an error! ");} Myman = new man (" Silly "," Men ", 10); Alert (Myman.name);
IF (TypeOf (n) == "undefined")
Alert ("undefined");
Function ChangeTheme (Style)
{
IF (Style! = NULL)
{
Document.createstylesheet (Style ". CSS");
}
}
script>
>>>>
The page has such a function: it is comparison after selecting several products in the previous page. There is a product button in the comparison page. I spent a lot of time for a few times, I have found some problems today. The last time there is a column of each product, record the list of the product to which the product belongs is recorded with a Radio tag, and then pass the product number, looping the list of the column DEL per line, but says that 2, 3, The RADIO value is 2, 3, and if the second column is deleted, the third column becomes the second column, but this RADIO value has not changed, and after all labels of the traversal page. Rendering:
Function delcol (Obj, I) {for (var j = 0; j <= obj.Rows.LENGTH-1; J ) {IF (j == 0) {Obj.Rows [J] .deletecell (i * 2- 1) obj.rows [j] .deletecell (i * 2-1) Tabcomp2.rows [j] .deletecell (i * 2-1) Tabcomp2.rows [j] .deletecell (i * 2-1) // Tabcomp3 .rows [j] .deletecell (i * 2-1) //tabcomp3.rows[j].deletecell(i*2-1)} else obj.rows [j] .deletecell (i)} resetValue (i); } Function ResetValue (IV) {for (VAR i = 0; I
The problem is solved, but it is a bit cancer, but it is mainly this time. Try some JS here, so as soon as you have forgotten, you can quickly find it: Table only provides the function of deleting a row: deleterow, but did not provide deletion A method of a column, so only the method of using a cell of a row: obj.rows [j] .deletecell (i), all properties of a label: var obj = frMinput; // a certain image Name VAR TTT = ""; for (var j = 0; j The element of the parent element can be expressed in Parentelement.Parentelement Can be used for a Radio detection: Function chkradios (frMradios) {for (var i = 0; i All-selection / cancel check box: function checkall (form) {for (var i = 0; i Copy: Function CopyText (OBJ) {var RNG = Document.body.createTextRange (); rng.movetoelementText (obj); rng.select (); rng.execcommand ('Copy'); Simple: Window.clipboardData.SetData ("Text", "Rrrrrrrrrrrrrrrr"); Get Content: Window.clipboardData.Getdata ("Text") Enumerate all elements on the page: for (i = 0; i JS is still a lot of not familiar, you have to take a good time. . .