ladybird/Tests/LibWeb/Text/input/HTML/HTMLInputElement-radio-groups.html
Tim Ledbetter 67981af276 LibWeb: Don't group radio buttons from different trees together
Previously, we were searching for other radio buttons from the document
root, rather than the element root.
2024-09-11 07:59:29 +02:00

23 lines
794 B
HTML

<!DOCTYPE html>
<script src="../include.js"></script>
<script>
test(() => {
const container = document.createElement("div");
container.innerHTML =
`<form>
<input type="radio" name="group1" id="radio1" checked>
<input type="radio" name="group1" id="radio2">
</form>`;
const radio1 = container.querySelector("#radio1");
const radio2 = container.querySelector("#radio2");
println(`Radio button 1 initial checkedness: ${radio1.checked}`);
println(`Radio button 2 initial checkedness: ${radio2.checked}`);
radio2.checked = true;
println(`Radio button 1 checkedness: ${radio1.checked}`);
println(`Radio button 2 checkedness: ${radio2.checked}`);
});
</script>