Added .form property for legend tag

This commit is contained in:
Adrian Utrilla 2016-04-03 18:25:40 +02:00
parent 88d29e537c
commit a8f9887d86
5 changed files with 73 additions and 24 deletions

View file

@ -13,11 +13,21 @@
</form>
</div>
<div style="display:none">
<form id="testformWithFieldSet">
<fieldset>
<legend id="legendWithFieldSet">radio</legend>
</fieldset>
</form>
</div>
<script>
test(function () {
var legendEle = document.getElementById("legendWithFieldSet");
assert_not_equals(legendEle.form, null);
assert_equals(legendEle.form, document.getElementById("testformWithFieldSet"));
}, "Check if legend.form returns its parent when it's inside a fieldset");
test(function () {
var legendEle = document.getElementById("testlegend");
assert_equals(legendEle.form, null);
}, "Check if legend.form return null when legend has no fieldset element as its parent");
</script>