abstract:<!DOCTYPE html><html><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>我的作业</title>
<style media="screen">
table{margin: 0px auto;}
div{width: 300px;height: 300px;background: pink;line-height: 300px;text-align: center;color:red;}
#div2{background: red;}
</style>
<script type="text/javascript">
function text1(a){
a.style.background="green";
}
function text2(b){
b.style.background="green";
}
function text3(c){
c.style.background="green";
}
</script>
</head>
<body>
<table>
<tr>
<td>
<div>元素获得焦点
<input type="text" name="" value="" onfocus="text1(this)">
</div>
</td>
<td>
<div>元素失去焦点
<input type="text" id="div2" value="" onblur="text2(this)">
</div>
</td>
<td>
<div>点击调用
<input type="button" name="" value="点击" onclick="text3(this)">
</div>
</td>
</tr>
</table>
</body>
</html>
事件可以理解,基本操作也可以掌握,还是需要多练习
Correcting teacher:灭绝师太Correction time:2019-02-28 09:37:52
Teacher's summary:完成的不错,事件方法的使用场景很多,要好好掌握