0Pricing
JavaScript Academy · Lesson

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

  1. Reading Input Values
  2. The submit Event
  3. Client-Side Validation
  4. The Constraint Validation API
← Back to JavaScript Academy