HTML Events Flashcards

1
Q

Give an example of registering an HTML event with a JS function

A

<button>Try it</button>
//where onclick is the property and the JS function is after the =

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

Can you list some common html events

A

onclick
onmouseover
onmouseout
onload
onchange

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

How else can a function be registered to an element

A

Directly in an event using a DOM property like
window.onload = (even) => { document.getElementById(“btnl”).addEventListener(“click”, changeText);}

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