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 =
2
Q
Can you list some common html events
A
onclick
onmouseover
onmouseout
onload
onchange
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);}