摘要:<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>js事件</title> </head> <body> <script type="text/javascrip
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>js事件</title>
</head>
<body>
<script type="text/javascript">
function myfovus(x){
x.style.background = 'red';
}
function myclic (y){
y.style.borderRadius = '50px',
}
</script>
姓名:<input type="text" onmouseover="myfovus(this)">
<div style="width: 100px;height: 100px;border: 1px solid #ccc;" onclick="myclic(this)"></div>
</body>
</html>function 函数名(参数一,...){
要执行的方法
}
"事件 "=函数名(this)