1. click:
Occurs when the mouse button is pressed and released on an element.
Example:
button.addEventListener('click', function() {
alert('Button was clicked!');
});
2. mousedown:
Occurs when the mouse button is pressed down over an element.
Example:
element.addEventListener('mousedown', function() {
alert('Mouse button pressed down!');
});
3. mouseup:
Occurs when the mouse button is released over an element.
Example:
element.addEventListener('mouseup', function() {
alert('Mouse button released!');
});
4. mousemove:
Occurs when the mouse is moved over an element.
Example:
element.addEventListener('mousemove', function() {
console.log('Mouse is moving over the element!');
});
5. mouseover:
Occurs when the mouse enters the area of an element.
Example:
element.addEventListener('mouseover', function() {
alert('Mouse entered the element!');
});
6. mouseout:
Occurs when the mouse leaves the area of an element.
Example:
element.addEventListener('mouseout', function() {
alert('Mouse left the element!');
});
7. mouseenter:
Similar to mouseover, but it doesn't bubble. This means that it won't be triggered by child elements.
Example:
element.addEventListener('mouseenter', function() {
alert('Mouse entered the element without triggering on children!');
});
8. mouseleave:
Similar to mouseout, but it doesn't bubble. This means that it won't be triggered by child elements.
Example:
element.addEventListener('mouseleave', function() {
alert('Mouse left the element without triggering on children!');
});