- Select
- Input
- Textarea
Requirement
Options
- Dynamic
- Static
...
Value
- HTML
- JS
const select = document.querySelector("#..."); console.log(select.value); // null if empty, // "fox" if Fox is selected, // "lion" if Lion is selected ...
console.log(select.value); // null if empty, // "squirrel" if Squirrel is selected, // "seal,fox" if Seal and Fox are selected ...
Attributes
[multiple]
[max]
[search]
[message]
Requirement
Value
- HTML
- JS
/* Get input value */ const input = document.querySelector("#..."); console.log(input.value); // return : // - null, if empty or error, // - otherwise, the entered value
Attributes
[label] & [unit]
[min] & [max]
[pattern]
[prevent]
[message]
Specific types
Type: number [decimal] & [local]
Type: tel [format]
Type: email [message.error]
Requirement
Value
- HTML
- JS
Lorem ipsum dolor sit amet...
/* Get textarea value */ const textarea = document.querySelector("#..."); console.log(textarea.value); // return : // - null, if empty or error, // - otherwise, the entered value