2024-04-12 13:48:13 -04: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);
|
2024-06-28 11:08:38 -04:00
|
|
|
document.getElementById('blabla').removeAttribute('rel');
|
|
|
|
var a2 = document.getElementById('blabla').getAttribute('rel');
|
|
|
|
console.assert(a2 === null, 'removed');
|
2024-04-12 13:48:13 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
function bb()
|
|
|
|
{
|
|
|
|
var b = document.getElementById('ble').getAttribute('href');
|
|
|
|
console.assert(b === null, b);
|
|
|
|
}
|
|
|
|
|
|
|
|
console.error('element.getAttribute.html');
|
|
|
|
aa();
|
|
|
|
bb();
|
2024-06-01 07:30:03 -04:00
|
|
|
console.exit();
|
2024-04-12 13:48:13 -04:00
|
|
|
</script>
|
|
|
|
<button onclick="return aa()">blabla rel nofollow</button>
|
|
|
|
<button onclick="return bb()">ble href null</button>
|
|
|
|
</body>
|
|
|
|
</html>
|