mirror of
https://github.com/rkd77/elinks.git
synced 2024-09-26 02:46:13 -04:00
[assert] element.hasAttribute
This commit is contained in:
parent
7c920847cb
commit
fc5f10c48e
30
test/ecmascript/assert/element.hasAttribute.html
Normal file
30
test/ecmascript/assert/element.hasAttribute.html
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<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').hasAttribute('rel');
|
||||||
|
console.assert(a, 'True');
|
||||||
|
}
|
||||||
|
|
||||||
|
function bb()
|
||||||
|
{
|
||||||
|
var b = document.getElementById('ble').hasAttribute('href');
|
||||||
|
console.assert(!b, 'False');
|
||||||
|
}
|
||||||
|
|
||||||
|
console.error('element.hasAttribute.html');
|
||||||
|
aa();
|
||||||
|
bb();
|
||||||
|
console.exit(0);
|
||||||
|
</script>
|
||||||
|
<button onclick="return aa()">blabla rel true</button>
|
||||||
|
<button onclick="return bb()">ble href false</button>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user