HTML event attribute onmouseout








The onmouseout attribute event is triggered when the mouse pointer moves out of an element.

What's new in HTML5

None.

Syntax

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

Supported Tags

All HTML elements, EXCEPT:

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




Browser compatibility

onmouseout Yes Yes Yes Yes Yes

Example

<!DOCTYPE html>
<html>
<body>
<!-- w  ww  .  j  av a  2  s . c  o m-->
<p id="p1" onmouseout="onmouseOut()" onmouseup="mouseUp()">
Click the text! 
</p>

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

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

</body>
</html>

Click to view the demo