Upload
ivan-matiishyn
View
116
Download
0
Embed Size (px)
Citation preview
Agenda
▪ Types of Events
▪ Registering Event Handlers
▪ Event Handler Argument
▪ Event Cancellation
▪ Bubbling
▪ Capturing
▪ References and sources
Types of Events
▪ onclick
▪ onmousedown, onmouseup,
▪ onmousemove, onmouseover,
onmouseout
<body>, <input>, <textarea>
▪ onkeydown
▪ onkeypress
▪ onkeyup
Types of Events
▪ onfocus, onblur
▪ onload, onunload, onresize
<form>, elements
▪ onreset, onsubmit
▪ onselect, onchange, onscroll
▪ HTML5 Events, Touchscreen
Event Handler Argument
▪ Any source– type
– targer / srcElement
▪ Mouse– button
– altKey, ctrlKey, shiftKey
– clientX, clientY
▪ Keyboard– keyCode
Bubbling
▪ After an event triggers on the deepest possible element, it then triggers on parents in nesting order.
References and sources
1. javascript.info2. JavaScript: The Definitive Guide, 6th Edition3. Everyone’s experience