<input>
, <textarea>
and <select>
elements that is executed when its value changes$('select').change((event) => {
const selectedOption = $(event.currentTarget).find(':selected').val()
alert(`You have selected ${$selectedOption}`)
})
We’ll discuss currentTarget
and the .find()
method later in the course