摘要:<!DOCTYPE html> <html> <head> <title></title> <!-- <script type="text/javascript" src="index.js"></script>
<!DOCTYPE html> <html> <head> <title></title> <!-- <script type="text/javascript" src="index.js"></script> --> </head> <body> <script type="text/javascript"> function zhuce(x,b) { x.style.background = b } </script> 姓名:<input type="text" onfocus="zhuce(this,'red')" onblur="zhuce(this,'pink')"> <!--鼠標(biāo)點(diǎn)擊獲取焦點(diǎn),和失去焦點(diǎn)后,輸入框變換顏色 也可以用其他驅(qū)動(dòng)事件函數(shù)做類(lèi)似事情,例如鼠標(biāo)移動(dòng)到某個(gè)元素上面等等。--> </body> </html>
批改老師:查無(wú)此人批改時(shí)間:2019-04-23 13:33:54
老師總結(jié):完成的不錯(cuò)。js代碼每行結(jié)束增加;號(hào)。繼續(xù)加油。