Add the test about Element attributes.

This commit is contained in:
Tetsuharu OHZEKI 2013-10-05 04:36:18 -07:00
parent 19c1b023e0
commit ecc68a5001

View file

@ -0,0 +1,29 @@
<html>
<head id="foo">
<title></title>
<script src="harness.js"></script>
</head>
<body>
<div id="test" foo="bar"></div>
<script>
let test = document.getElementById("test");
{
let r1 = test.getAttribute("id");
is(r1, "test", "test1-0, Element.getAttribute().");
let r2 = test.getAttribute("foo");
is(r2, "bar", "test1-1, Element.getAttribute().");
}
{
let NAME = "hoge";
let VALUE = "fuga";
test.setAttribute(NAME, VALUE);
let r = test.getAttribute(NAME);
is(r, VALUE, "test2. Element.setAttribute().");
}
finish();
</script>
</body>
</html>