ladybird/Tests/LibWeb/Text/input/fieldset-elements.html
2023-12-10 08:07:41 -05:00

24 lines
807 B
HTML

<script src="./include.js"></script>
<script>
test(() => {
let testCounter = 1;
function testPart(part) {
println(`${testCounter++}. ${JSON.stringify(part())}`);
}
// 1. Get fieldset elements length
testPart(() => {
const fieldset = document.createElement('fieldset');
fieldset.innerHTML = `<input><input><button></button>`;
return fieldset.elements.length;
});
// 2. Get fieldset elements set stuff
testPart(() => {
const fieldset = document.createElement('fieldset');
fieldset.innerHTML = `<input><input value="FAIL"><button></button>`;
fieldset.elements[0].value = 'PASS';
return fieldset.children[0].value;
});
});
</script>