JavaScript Reference/Javascript Methods/addElement — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 11:22, 26 мая 2010
"addElement()" Example
<source lang="javascript">
<html> <head> <script language="JavaScript"> function function1() {
myRange = document.body.createControlRange(); myDiv = document.createElement("div"); document.body.insertBefore(myDiv); myDiv.style.position = "absolute"; myDiv.innerText = "Here is the new content."; myRange.addElement(myDiv);
} </script> </head> <body> <input id=myB
type="button" value="Add element to the controlRange collection" onclick="function1();">
</body> </html>
</source>
"addElement()" is applied to
<source lang="javascript">
Names noted with an asterisk (*) are JavaScript properties only. +----------------+--------------------------------------------------------------+ | Applied_To |controlRange* | +----------------+--------------------------------------------------------------+
</source>
"addElement()" Syntax, Parameters and Note
<source lang="javascript">
Note: Adds an element to the controlRange collection.
Syntax:
controlRangeName.addElement(param1)
Parameters:
param1 Required; the element to add. </source>