Client Insert Control

xiaoxiao2021-03-06  55

The controls in this article generally refer to any legal HTML tag

Method 1:

// Container VAR STRINNERHTML = ""; // To add control docuemnt.all.form1.mydiv .innerhtml = strinnerhtml; // Perform addition action method 2:
// Container Var strinnerhtml = ""; // Added control // Exercise Add action docuemnt.all.form1.mydiv.insertadjacenthtml ('afterbegin', strinnerhtml); where the first parameters are as follows: afterbegin - Insert content in the front container; beforeend - in text Insert content in the rear container; BeforeBegin - Insert content in the front of the text, Afterend - Insert content of the container after text; method 3:
// Container var ObjNode = Document.createElement ("INPUT"); // Create an Input Control / / Start Specify control attribute objNode.Type = 'text'; objNode.Id = 'myinput'; ObjNode.Value = 'test'; docuemnt.all.form1.mydiv. INSERTADJACENTELEMENT ("BeForeEnd", ObjNode); // Perform additional control method control method: ChildNodes (INDEX) - acquire child control Parentelement - get the parent control RemoveNode - Delete the current control

转载请注明原文地址:https://www.9cbs.com/read-93984.html

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.046, SQL: 9