blob: a28add515f31bb26c848affb831924817c29876a [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../../resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description('Test to see if setting the value attribute updates the value.');
var input = document.createElement('input');
input.type = 'range';
shouldBe('input.setAttribute("value", "10"); input.value', '"10"');
input.setAttribute('min', '0');
input.setAttribute('max', '100');
debug("rewriting the value attribute should update the value")
shouldBe('input.setAttribute("value", "20"); input.value', '"20"');
debug("changing the max should effect value")
shouldBe('input.setAttribute("max", "10"); input.value', '"10"');
debug("value attribute should not change the value after you set a value")
shouldBe('input.value = 10; input.setAttribute("value", "5"); input.value', '"10"');
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>