Javascript核心篇-事件
张翔2019-05-16 15:43:41191 <!DOCTYPE html>
<html>
<head>
<title>Javascript核心篇-事件</title>
</head>
<body>
<script type="text/javascript">
function myfovus(x){
x.style.background = 'pink';
}
function myclick(y){
y.style.background = 'blue';
}
function myclick2(z){
z.style.borderRadius = '50%';
}
</script>
input1:<input type="text" onfocus="myfovus(this)" name="">
<br>
input2:<input type="text" onmouseover="myfovus(this)" name="">
<br>
<div style="width: 200px; height: 200px; border:1px solid #ccc;" onclick="myclick(this)"></div>
<div style="width: 200px; height: 200px; border:1px solid #ccc; background:blue;" onclick="myclick2(this)"></div>
</body>
</html>