Eventos (JavaScript + Lógica de programação) Flashcards

1
Q

Eventos a partir do javaScript

A

HTML

<select>
<option>Opção 1</option>
<option>Opção 2</option>
</select>

JAVASCRIPT

document.querySelector(“select[name=’select-option’]”).addEventListener(“change”, function() {
alert(event.target.value)
})

How well did you know this?
1
Not at all
2
3
4
5
Perfectly