test1.html <!doctype html> <html lang="en"> <head> <!--设置equiv属性--> <meta charset="UTF-8"> <meta http-equiv="content-Language" contect="zh-CN"> <!--设定网页的过期时间--> <meta http-equiv="Pragma" content="no-cache"> <!--指定是否允许用户自己缩放--> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"> <!--忽略将页面中的数字识别为电话号码--> <meta name="format-detection" content="telephone=no"> <meta name="apple-mobile-web-app-capable" content="no"> <style> h1{behavior:url(pie.htc)} </style> </head> <body> <h1>把鼠标放在这里</h1> </body> </html> pie.htc <public:attach event="onmouseover" onevent="befor()" /> <public:attach event="onmouseout" onevent="after()" /> <script type="text/javascript"> function befor(){ this.style.backgroundColor="#7FFFAA"; this.style.color="red"; this.style.cursor="pointer"; } function after(){ this.style.backgroundColor=""; this.style.color=""; this.style.cursor=""; } </script>