0
0
mirror of https://github.com/rkd77/elinks.git synced 2025-09-21 19:46:23 -04:00
Files
elinks/test/js/assert/element.getAttribute.html

36 lines
878 B
HTML
Raw Normal View History

2024-04-12 19:48:13 +02:00
<html>
<body>
<a href="/home">BBB</a>
<b id="aaaa">bbb</b>
<a id="blabla" href="/" rel="nofollow">
<b>AAA</b><u id="ble">UUU</u>AAAAAAA
</a>
<a id="bb" href="/">BB</a>
<script>
function aa()
{
var a = document.getElementById('blabla').getAttribute('rel');
console.assert(a === 'nofollow', a);
document.getElementById('blabla').removeAttribute('rel');
var a2 = document.getElementById('blabla').getAttribute('rel');
console.assert(a2 === null, 'removed');
2024-04-12 19:48:13 +02:00
}
function bb()
{
var b = document.getElementById('ble').getAttribute('href');
console.assert(b === null, b);
2024-09-19 19:10:26 +02:00
var c = document.getElementById('ble').getAttribute(null);
console.assert(c === null, c);
2024-04-12 19:48:13 +02:00
}
console.error('element.getAttribute.html');
aa();
bb();
console.exit();
2024-04-12 19:48:13 +02:00
</script>
<button onclick="return aa()">blabla rel nofollow</button>
<button onclick="return bb()">ble href null</button>
</body>
</html>