1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en">
5 <title>importNode
</title>
9 <p>This is a simple test of both importNode and cloneNode, created from an example that demonstrated a bug in importNode.
</p>
10 <div style=
"background: yellow;">The original node:
</div>
11 <div id=
"original" style=
"background: #7F7FFF; padding: 3px">Outer bit
<div style=
"color: yellow; background: blue; margin: 3px;">Inner bit.
</div></div>
12 <div style=
"background: yellow;">Copied with importNode():
</div>
13 <div id=
"cloneTitle" style=
"background: yellow;">Copied with cloneNode():
</div>
14 <script type=
"text/javascript">
15 document.getElementById('container').insertBefore(document.importNode(document.getElementById('original'), true), document.getElementById('cloneTitle'));
16 document.getElementById('container').appendChild(document.getElementById('original').cloneNode(true));