1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 04:27:45 +00:00

Ladybird+LibWeb: Add basic select element support

This commit is contained in:
Bastiaan van der Plaat 2023-12-07 15:53:49 +01:00 committed by Andreas Kling
parent b439431488
commit 466153e680
28 changed files with 641 additions and 4 deletions

View file

@ -0,0 +1,61 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Select showcase</title>
</head>
<body>
<p>Basic select:</p>
<p>
<select onchange="document.getElementById('a-value').textContent = this.value">
<option value="one">One</option>
<option value="two">Two</option>
<option value="three">Three</option>
<option value="four">Four</option>
<option value="five">Five</option>
</select>
Value: <span id="a-value">?</span>
</p>
<p>Basic select with separators:</p>
<p>
<select onchange="document.getElementById('b-value').textContent = this.value" style="width: 50%;">
<option value="one">One</option>
<option value="two">Two</option>
<hr>
<option value="three">Three</option>
<option value="four">Four</option>
<hr>
<option value="five">Five</option>
<option value="six">Six</option>
</select>
Value: <span id="b-value">?</span>
</p>
<p>Basic select with option groups and separators:</p>
<p>
<select onchange="document.getElementById('c-value').textContent = this.value">
<optgroup label="8.01 Physics I: Classical Mechanics">
<option value="8.01.1">Lecture 01: Powers of Ten
<option value="8.01.2">Lecture 02: 1D Kinematics
<option value="8.01.3">Lecture 03: Vectors
<hr>
<option value="8.01.4">Lecture 04: Random
<optgroup label="8.02 Electricity and Magnetism">
<option value="8.02.1">Lecture 01: What holds our world together?
<option value="8.02.2">Lecture 02: Electric Field
<option value="8.02.3">Lecture 03: Electric Flux
<hr>
<option value="8.02.4">Lecture 04: Random
<optgroup label="8.03 Physics III: Vibrations and Waves">
<option value="8.03.1">Lecture 01: Periodic Phenomenon
<option value="8.03.2">Lecture 02: Beats
<option value="8.03.3">Lecture 03: Forced Oscillations with Damping
<hr>
<option value="8.03.4">Lecture 04: Random
</select>
Value: <span id="c-value">?</span>
</p>
</body>
</html>