3 <title>Test CloneNode
</title>
4 <script type=
"text/javascript">
7 var brNode
= document
.createElement("br");
9 var myDiv
= document
.getElementById("myDiv");
10 myDiv
.style
["fontSize"] = "30";
11 myDiv
.style
["borderWidth"] = "2";
12 myDiv
.style
["borderStyle"] = "ridge";
13 myDiv
.style
["backgroundColor"] = "yellow";
15 var myClonedDiv
= myDiv
.cloneNode(false);
16 myClonedDiv
.id
= "myClonedDiv";
17 myClonedDiv
.appendChild(brNode
);
18 myDiv
.parentNode
.appendChild(document
.createTextNode("Cloned Node with deep=false"));
19 myDiv
.parentNode
.appendChild(myClonedDiv
);
21 var myDeepClonedDiv
= myDiv
.cloneNode(true);
22 myDeepClonedDiv
.id
= "myDeepClonedDiv";
23 myDiv
.parentNode
.appendChild(document
.createTextNode("Cloned Node with deep=true"));
24 myDiv
.parentNode
.appendChild(myDeepClonedDiv
);
30 <body onload=
"init()" style=
"overflow:hidden;">
31 <h1>Cloning nodes
</h1>
33 <span style=
"font-weight:bold">Bold
<span style=
"text-decoration:underline">Bold+Underline
<span style=
"font-style:italic">Bold+Underline+Italic
</span>Bold+Uunderline
</span>Bold
</span>