Home >Web Front-end >HTML Tutorial >Complete html example code of mouse click, passing, and mouse leaving events (picture)

Complete html example code of mouse click, passing, and mouse leaving events (picture)

PHPz
PHPzOriginal
2017-04-23 10:46:409638browse

This article explains the htm implementation method of mouse click, pass, and mouse leave events. The following is the complete html example code

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript">
var a,b,c;
a=100;b=200;

c=a;a=b;b=c;
console.log(a,b);
alert(a+" "+b);
window.onload=function(){
var sj;
sj=document.getElementById("a");
sj.style.color="pink";
sj.style.width="100px";
sj.style.lineHight="30px";
sj.style.lineHight="30px";
sj.style.textAlign="center";
sj.style.background="purple";

}
</script>
</head>
<body>
<p onclick="alert(&#39;php中文网html实例&#39;)">点击有惊喜!</p>
<marquee onmouseover="this.stop()"onmouseout="this.start()">我是php中文网(www.php.cn)!</marquee>

<p onclick="alert(&#39;别人都叫我小猪&#39;)" id="a">请叫我钟老师</p>

</body>
</html>

The display effect of mouse click, pass, and mouse leave events:

Complete html example code of mouse click, passing, and mouse leaving events (picture)


The above is the detailed content of Complete html example code of mouse click, passing, and mouse leaving events (picture). For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn