HTML event attribute onmouseover








The onmouseover attribute event is triggered when the mouse point is over the element.

What's new in HTML5

None.

Syntax

<element onmouseover="script or Javascript function name">

Supported Tags

All HTML elements, EXCEPT:

<base>, 
<bdo>, 
<br>, 
<head>, 
<html>, 
<iframe>, 
<meta>, 
<param>, 
<script>, 
<style>, 
<title>




Browser compatibility

onmouseover Yes Yes Yes Yes Yes

Example

<!DOCTYPE html>
<html>
<body>
<!--  w ww . j a v a2  s . c  om-->
<p id="p1" onmouseover="onmouseOver()" onmouseup="mouseUp()">
Click the text! 
</p>

<script>
function onmouseOver() {
    console.log("onmouseOver");
}

function mouseUp() {
    console.log("up");
}
</script>

</body>
</html>

Click to view the demo