We'll continue working with our events playground code: https://github.com/PacktPublishing/Hands-on-JavaScript-for-Python-Developers/blob/master/chapter-7/events/index.js.
On lines 32–34, we registered three click event listeners, as shown:
document.querySelector('html').addEventListener('click', logClick, true)
document.querySelector('body').addEventListener('click', logClick)
document.querySelector('button').addEventListener('click', logClick)
As we discussed, the first one is listening in the capture phase because we've included the final Boolean parameter.
We also have three mousemove events on lines 16–29. Let's take a look at one of them:
document.querySelector('button').addEventListener('mousemove', (e) => {
document.querySelector('#x').value = e.x
document.querySelector('#y').value = e.y
})
I hope most...