1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-20 01:46:15 -04:00
elinks/test/ecmascript/assert/element.closest.html

22 lines
595 B
HTML
Raw Normal View History

2024-04-12 11:29:46 -04:00
<!DOCTYPE html>
<html>
<body>
<div class="demo container"> Grandparent
<div class="demo container">Parent
<div id="myElement" class="demo">The outer HTML of closest element will be shown.</div>
</div>
</div>
<script>
var element = document.getElementById("myElement");
var closest = element.closest(".container");
console.error('element.closest.html');
console.assert(closest.outerHTML === '<DIV class="demo container">Parent\n <DIV id="myElement" class="demo">The outer HTML of closest element will be shown.</DIV>\n </DIV>', 'TODO');
console.exit(1);
</script>
</body>
</html>