2024-04-12 14:44:25 -04:00
|
|
|
<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;
|
2024-05-08 09:57:56 -04:00
|
|
|
console.assert(a1 === '\n<b>AAA</b><u id="ble">UUU</u>AAAAAAA\n', a1);
|
2024-04-12 14:44:25 -04:00
|
|
|
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;
|
2024-05-08 09:57:56 -04:00
|
|
|
console.assert(b1 === '<a id="blabla" href="/"><u>test</u><b>OK</b></a>', 'Changed');
|
2024-04-12 14:44:25 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
console.error('element.innerHTML.html');
|
|
|
|
aa();
|
|
|
|
bb();
|
2024-06-01 07:30:03 -04:00
|
|
|
console.exit();
|
2024-04-12 14:44:25 -04:00
|
|
|
</script>
|
|
|
|
<button onclick="return aa()">Click me!</button>
|
|
|
|
<button onclick="return bb()">innerText test</button>
|
|
|
|
</body>
|
|
|
|
</html>
|