mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:07:35 +00:00
LibWeb: Add output element value
This commit is contained in:
parent
f8509e2183
commit
fef7571931
5 changed files with 84 additions and 4 deletions
27
Tests/LibWeb/Text/input/output-value.html
Normal file
27
Tests/LibWeb/Text/input/output-value.html
Normal file
|
@ -0,0 +1,27 @@
|
|||
<script src="./include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
let testCounter = 1;
|
||||
function testPart(part) {
|
||||
println(`${testCounter++}. ${JSON.stringify(part())}`);
|
||||
}
|
||||
|
||||
// 1. Set output element value
|
||||
testPart(() => {
|
||||
const output = document.createElement('output');
|
||||
output.value = 'PASS';
|
||||
return output.textContent;
|
||||
});
|
||||
|
||||
// 2. Set output element default value and reset
|
||||
testPart(() => {
|
||||
const form = document.createElement('form');
|
||||
const output = document.createElement('output');
|
||||
output.defaultValue = 'PASS';
|
||||
output.value = 'FAIL';
|
||||
form.appendChild(output);
|
||||
form.reset();
|
||||
return output.textContent;
|
||||
});
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue