20 lines
1.1 KiB
HTML
20 lines
1.1 KiB
HTML
<html>
|
|
<head>
|
|
<title>importNode</title>
|
|
</head>
|
|
<body>
|
|
<div id="container">
|
|
<p>This is a simple test of both importNode and cloneNode, created from an example that demonstrated a bug in importNode.</p>
|
|
<div style="background: yellow;">The original node:</div>
|
|
<div id="original" style="background: #7F7FFF; padding: 3px">Outer bit<div style="color: yellow; background: blue; margin: 3px;">Inner bit.</div></div>
|
|
<div style="background: yellow;">Copied with importNode():</div>
|
|
<div id="cloneTitle" style="background: yellow;">Copied with cloneNode():</div>
|
|
<script type="text/javascript">
|
|
document.getElementById('container').insertBefore(document.importNode(document.getElementById('original'), true), document.getElementById('cloneTitle'));
|
|
document.getElementById('container').appendChild(document.getElementById('original').cloneNode(true));
|
|
</script>
|
|
</div>
|
|
</body>
|
|
</html>
|
|
|