We will use data-target
to tell our controller which input element we are getting our value from.
We need to declare static targets = ['name']
in our controller to tell which element we are referencing. We then reference the value in the input element with this.nameTarget.value
.