event attributes of HTML em element
onmouseup
onmouseup attribute of HTML em element initiates some action predefined in a script associated with it, when the user releases the mouse button while the cursor is positioned on the element.
Syntax
<em onmouseup="some_script | calling some script">text content</em>
Example of using onmouseup with em element
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>HTML em tag example - HTML tutorial | w3resource</title>
<script type="text/javascript">
function w3r_em_onmouseup(){
alert("Thanks for visiting w3reource.");
}
</script>
</head>
<body>
<p>This is an example of <em onclick="w3r_em_onmouseup()">HTML em tag.</em></p>
</body>
</html>
Result
View this example in a separate browser window
Example of onmouseup attribute of em element
onmouseover
onmouseover attribute of HTML em element initiates some action predefined in a script associated with it, when the user moves the cursor into the boundary of the element.
Syntax
<em onmouseover="some_script | calling some script">text content</em>
Example of using onmouseover with em element
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>HTML em tag example - HTML tutorial | w3resource</title>
<script type="text/javascript">
function w3r_em_onmouseover(){
alert("Thanks for visiting w3reource.");
}
</script>
</head>
<body>
<p>This is an example of <em onmouseover="w3r_em_onmouseover()">HTML em tag.</em></p>
</body>
</html>
Result
View this example in a separate browser window
Example of onmouseover attribute of em element
onmousemove
onmousemove attribute of HTML em element initiates some action predefined in a script associated with it, when the user moves the mouse pointer any in any direction, irrespective of any mouse button actions on the element.
Syntax
<em onmousemove="some_script | calling some script">text content</em>
Example of using onmousemove with em element
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>HTML em tag example - HTML tutorial | w3resource</title>
<script type="text/javascript">
function w3r_em_onmousemove(){
alert("Thanks for visiting w3reource.");
}
</script>
</head>
<body>
<p>This is an example of <em onmousemove="w3r_em_onmousemove()">HTML em tag.</em></p>
</body>
</html>
Result
View this example in a separate browser window
Example of onmousemove attribute of em element
onmouseout
onmouseout attribute of HTML em element initiates some action predefined in a script associated with it, when the user moves the mouse pointer any in any direction, irrespective of any mouse button actions on the element.
Syntax
<em onmouseout="some_script | calling some script">text content</em>
Example of using onmouseout with em element
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>HTML em tag example - HTML tutorial | w3resource</title>
<script type="text/javascript">
function w3r_em_onmouseout(){
alert("Thanks for visiting w3reource.");
}
</script>
</head>
<body>
<p>This is an example of <em onmouseout="w3r_em_onmouseout()">HTML em tag.</em></p>
</body>
</html>
Result
View this example in a separate browser window
Example of onmouseout attribute of em element
Continue reading to learn more event attributes of HTML em tag.
Previous: event attributes of HTML em element
Next: event attributes of HTML em element completed
Test your Programming skills with w3resource's quiz.
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://w3resource.com/html/em/HTML-em-tag-event-attributes-continued.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics