abstrakt:<!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>我的作業(yè)</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>元素獲得焦點(diǎn)
<input type="text" name="" value="" onfocus="text1(this)">
</div>
</td>
<td>
<div>元素失去焦點(diǎn)
<input type="text" id="div2" value="" onblur="text2(this)">
</div>
</td>
<td>
<div>點(diǎn)擊調(diào)用
<input type="button" name="" value="點(diǎn)擊" onclick="text3(this)">
</div>
</td>
</tr>
</table>
</body>
</html>
事件可以理解,基本操作也可以掌握,還是需要多練習(xí)
Korrigierender Lehrer:滅絕師太Korrekturzeit:2019-02-28 09:37:52
Zusammenfassung des Lehrers:完成的不錯(cuò),事件方法的使用場(chǎng)景很多,要好好掌握