blob: 1b17193f637b89cbf04b11912ca27ec43f795bb7 [file] [log] [blame]
<html>
<head>
<script src="../../../resources/js-test-pre.js"></script>
</head>
<body>
<span id="for-target1"></span>
<span id="for-target2"></span>
<output id="output1" name="output1">A value</output>
<output id="output2" for="for-target1"></output>
<output id="output3" for=" for-target1 for-target2 "></output>
<script>
description('Tests for content attributes of the output element.');
var output1 = document.getElementById('output1');
var output2 = document.getElementById('output2');
var output3 = document.getElementById('output3');
shouldBeEqualToString('output1.type', 'output');
shouldBeEqualToString('output1.name', 'output1');
shouldBeEqualToString('output1.value', 'A value');
shouldEvaluateTo('output2.htmlFor.length', 1);
shouldBeEqualToString('output2.htmlFor[0]', 'for-target1');
shouldBeEqualToString('String(output2.htmlFor)', 'for-target1');
shouldBeEqualToString('output2.htmlFor.value', 'for-target1');
shouldEvaluateTo('output3.htmlFor.length', 2);
shouldBeEqualToString('output3.htmlFor[0]', 'for-target1');
shouldBeEqualToString('output3.htmlFor[1]', 'for-target2');
shouldBeEqualToString('String(output3.htmlFor)', ' for-target1 for-target2 ');
shouldBeEqualToString('output3.htmlFor.value', ' for-target1 for-target2 ');
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>