mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-31 22:56:04 +00:00
LibWeb: Implement cloning steps for HTMLInputElement
This commit is contained in:
parent
d8c69a0e9e
commit
71cfa705d1
Notes:
github-actions[bot]
2024-08-25 10:54:28 +00:00
Author: https://github.com/tcl3
Commit: 71cfa705d1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1185
4 changed files with 39 additions and 0 deletions
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../include.js"></script>
|
||||
<form>
|
||||
<input id="checkedCheckbox" type="checkbox">
|
||||
<input type="text" value="FAIL">
|
||||
</form>
|
||||
<script>
|
||||
test(() => {
|
||||
const form = document.forms[0];
|
||||
const inputs = form.getElementsByTagName("input");
|
||||
inputs[0].checked = true;
|
||||
inputs[1].value = "PASS";
|
||||
|
||||
const clone = form.cloneNode(true);
|
||||
document.body.appendChild(clone);
|
||||
|
||||
println(`Cloned checkbox checked: ${clone.querySelector("input[type=checkbox]").checked}`);
|
||||
println(`Cloned text input value: ${clone.querySelector("input[type=text]").value}`);
|
||||
|
||||
form.remove();
|
||||
clone.remove();
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue