Mouse event handlers
There are different mouse event handlers. Mouse events are actions of the mouse. These are the ones we have:
ondblclick
: when the mouse is double-clickedonmousedown
: when the mouse clicks on top of an element without the click being releasedonmouseup
: when the mouse click on top of an element is releasedonmouseenter
: when the mouse moves onto an elementonmouseleave
: when the mouse leaves an element and all of its childrenonmousemove
: when the mouse moves over an elementonmouseout
: when the mouse leaves an individual elementonmouseover
: when the mouse hovers over an element
Let's have a look at one of these in practice. What do you think this does?
<!doctype html>
<html>
<body>
<div id="divvy" onmouseover="changeColor()" style="width: 100px; height: 100px; background-color: pink;">
<script>
function changeColor...