标签:
<!DOCTYPE html> <html> <head> <title>javascript事件处理</title> <meta charset="UTF-8"> <script type="text/javascript"> function clickD(obj){ alert(obj.innerHTML); } function moveD(obj){ //设置这个对象的颜色,在js中设置文本的样式均通过xx.style.样式的名称 obj.style.color = "#f00"; obj.style.fontSize = "18px"; } function leaveD(obj){ obj.style.color = "#000"; obj.style.fontSize = "12px"; } </script> </head> <body> <div onclick="clickD(this)" style="cursor: pointer">点击一下试试</div> <div onmouseover="moveD(this)" onmouseout="leaveD(this)">鼠标移动上去试试</div> </body> </html>
标签:
原文地址:http://www.cnblogs.com/aicpcode/p/4276237.html