mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05:00
33 lines
738 B
HTML
33 lines
738 B
HTML
<html>
|
|
<body>
|
|
<b id="test">Test</b>
|
|
|
|
<div id="container">
|
|
<div id="d">This is a div.</div>
|
|
</div>
|
|
|
|
<script>
|
|
function aa()
|
|
{
|
|
var a1 = document.getElementById('test').outerHTML;
|
|
console.assert(a1 === '<b id="test">Test</b>', a1);
|
|
}
|
|
|
|
function bb()
|
|
{
|
|
var container = document.getElementById("container");
|
|
var d = document.getElementById("d");
|
|
console.assert(container.firstElementChild.nodeName === 'DIV', 'DIV');
|
|
d.outerHTML = '<p>' + d.outerHTML + '</p>';
|
|
console.assert(container.firstElementChild.nodeName === 'P', 'P');
|
|
console.assert(container.innerHTML === '\n <p></p><div id="d">This is a div.</div><p></p>\n', 'div p div');
|
|
}
|
|
|
|
console.error('element.outerHTML.html');
|
|
aa();
|
|
bb();
|
|
console.exit();
|
|
</script>
|
|
</body>
|
|
</html>
|