mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05:00
[assert] element.innerHTML.html
This commit is contained in:
parent
4128945063
commit
84ce531210
33
test/ecmascript/assert/element.innerHTML.html
Normal file
33
test/ecmascript/assert/element.innerHTML.html
Normal file
@ -0,0 +1,33 @@
|
||||
<html>
|
||||
<body>
|
||||
<a href="/home">BBB</a>
|
||||
<b id="aaaa">bbb</b>
|
||||
<a id="blabla" href="/">
|
||||
<b>AAA</b><u id="ble">UUU</u>AAAAAAA
|
||||
</a>
|
||||
<a id="bb" href="/">BB</a>
|
||||
<script>
|
||||
function aa()
|
||||
{
|
||||
var a1 = document.getElementById('blabla').innerHTML;
|
||||
console.assert(a1 === '\n<B>AAA</B><U id="ble">UUU</U>AAAAAAA\n', a1);
|
||||
var a2 = document.getElementById('ble').innerHTML;
|
||||
console.assert(a2 === 'UUU', 'UUU');
|
||||
}
|
||||
|
||||
function bb()
|
||||
{
|
||||
document.getElementById('blabla').innerHTML = '<u>test</u><b>OK</b>';
|
||||
var b1 = document.getElementById('blabla').outerHTML;
|
||||
console.assert(b1 === '<A id="blabla" href="/"><U>test</U><B>OK</B></A>', 'Changed');
|
||||
}
|
||||
|
||||
console.error('element.innerHTML.html');
|
||||
aa();
|
||||
bb();
|
||||
console.exit(0);
|
||||
</script>
|
||||
<button onclick="return aa()">Click me!</button>
|
||||
<button onclick="return bb()">innerText test</button>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user