Reading Input Values
Access values from text, checkbox, and select inputs.
Working With Form Data
Forms collect user input through fields like text boxes, checkboxes, radios, and dropdowns. Each exposes its data slightly differently.
input.value
Text-like inputs expose their current contents through the value property, always a string.
const name = document.querySelector("#name");
console.log(name.value);All lessons in this course
- Reading Input Values
- The submit Event
- Client-Side Validation
- The Constraint Validation API