1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00
elinks/test/ecmascript/assert/element.outerHTML.html
2024-05-08 18:57:11 +02:00

33 lines
739 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(0);
</script>
</body>
</html>