Inputs
We’ll cycle back to inputs at a later class date, but here’s the quick basics of inputs.
We’ll be working with two basic kinds of inputs throughout much of this class.
Text Inputs
The first is this, boring, textual input:
To get a reference to this input in our javascript, we would then write this
To get the text that a user has typed into that input, we would use the .value property of the reference.
Buttons
A second ‘input’ we will use with startling regularity is the button.
TO respond to clicks, we would then write this code
Resetting Inputs
Sometimes its helpful to remove the text inside an input. Here is how one goes about “resetting” an input.