????:<!doctype html> <html> <head> <meta charset="utf-8"> <title>javascript事件</title> </head> <style type="text/css"> &nbs
<!doctype html> <html> <head> <meta charset="utf-8"> <title>javascript事件</title> </head> <style type="text/css"> .box1{background: #5F8F17;height: 200px;width: 200px; margin-top: 30px;} </style> <script type="text/javascript"> function testOnclick(){ alert("good"); }; function testOndblClick(){ alert("你好"); }; function testMouse(){ alert("哈哈"); }; function onkeyUp(){ alert("測(cè)試鍵盤的松開"); } function onkeyDown(){ alert("測(cè)試鍵盤的按下"); } function onkeyPress(){ alert("測(cè)試鍵盤的按下,shift和backpace無(wú)效") }; function testOnfocus(x){ x.style.background="red"; }; function testOnBlur(y){ y.style.background="pink";; }; function testOnload(){ alert("頁(yè)面加載完成") } </script> <body onLoad="testOnload()" > <input type="button" value="單擊" onClick="testOnclick()"> <input type="button" value="雙擊" ondblClick="testOndblClick()"> <div class="box1" onmousemove="testMouse()"> </div> <input type="text" value="測(cè)試鍵盤的松開" onkeyup="onkeyUp()"/><br> <input type="text" value="測(cè)試鍵盤的按下" onkeydown="onkeyDown()"/><br> <input type="text" value="測(cè)試鍵盤的按下" onkeypress="onkeyPress()"/><br> <input type="text" value="測(cè)試獲取焦點(diǎn)" onfocus="testOnfocus(this)"/><br> <input type="text" value="測(cè)試失去焦點(diǎn)" onblur="testOnBlur(this)"/><br> </body> </html>
?? ???:查無(wú)此人?? ??:2019-05-07 09:36:35
???? ??:完成的不錯(cuò)。js的動(dòng)畫很難掌握,要堅(jiān)持。繼續(xù)加油。