1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[test] test case for element.dataset

This commit is contained in:
Witold Filipczyk 2024-06-28 14:14:24 +02:00
parent fbbba38b8a
commit a7bf39e9a6

View File

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<body>
<div id="a" data-a="1" data-b="abc" data-cd="123"></div>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var div = document.getElementById('a');
console.assert(div.dataset.b === 'abc', 'abc');
div.dataset.b = '123';
console.assert(div.dataset.b === '123', '123');
}
console.error('element.dataset.html');
myFunction();
console.exit();
</script>
</body>
</html>