JavaScript Reference/Javascript Methods/createElement
Версия от 21:30, 25 мая 2010; (обсуждение)
"createElement()" Example
<source lang="javascript">
<html> <body> <script language="javascript"> function function1(){
var myElement = document.createElement("");
myBody.appendChild(myElement); myElement = document.createElement("myElement = document.createElement("
"); myBody.appendChild(myElement);
");
myBody.appendChild(myElement);
} </script> <body id="myBody"> <button onClick="function1();">Put horizontal rule</button> </body> </html>
</source>
"createElement()" is applied to
<source lang="javascript">
+----------------+--------------------------------------------------------------+ | Applied_To |document | +----------------+--------------------------------------------------------------+
</source>
"createElement()" Syntax, Parameters and Note
<source lang="javascript">
Note: Creates a new element.
Syntax:
document.createElement(param1) Parameters:
param1 Required; the tag name of the new element. </source>