Get values from form inputs

In JQuery, we use the .val() method to get or set values to input of forms. In Javascript, we have the .value method.

Refer to the following code snippet to learn how to select DOM elements in both jQuery and vanilla JavaScript:

$('.input').val(); // to get the value of the input
$('.input').val("New value"); // to set a new value to the input
let someInputElement = document.querySelector('.input'); 
someInputElement .value; // Read
someInputElement.value = "New value"; // Write