<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">Html,body{height:100%; Overflow:hidden;} Body,div,form,h2,ul,li{margin:0;padding:0;} Ul{list-style-Type:none;} Body{background: #23384e; font:12px/1.5 \5fae\8f6f\96c5\9ed1;} #search, #search form, #search. box, #search. Select, #search a{background:url (img/search.jpg) no-repeat;}#search, #search. box, #search form{height:34px;} #search {position:relative;width:350px;margin:10px Auto;} #search. Box{background-position:right 0;} #search Form{background-repeat:repeat-x;background-position:0 -34px;margin:0 20px 040px;} #search. select{float: Left;color: #fff; width:190px;height:22px;cursor:pointer;margin-top:4px;line-height:22px;padding-left:10px; Background-position:0-68px;} #search a{float: Left;width:80px;height:24px;color: #333; letter-spacing:4px;line-height:22px;text-align:center;text-decoration: none;background-position:0 -90px;margin:4px 0 010px;} #search A:hover{color: #f60; background-position:-80px-90px;} #search. Sub{position:absolute;top:26px;left:40px;color: #fff; Width:198px;background: #2b2b2b; border:1px solid #fff ;d Isplay:none;} #search. Sub Li{height:25px;line-height:24px;cursor:pointer;padding-left:10px;margin-bottom:-1px;border-bottom:1px dotted #fff;} #search. Sub li.hover{background: #8b8b8b;}</style><script type= "Text/javascript" >window.onload=function (){ varOselect = document.getElementsByTagName ("span") [0]; varOsub = document.getElementsByTagName ("ul") [0]; varALi = Osub.getelementsbytagname ("li"); vari = 0; Oselect.onclick=function(event) {varstyle =Osub.style; Style.display= Style.display = = "Block"? "None": "Block"; //Block Event bubbling(Event | | window.event). cancelbubble =true }; for(i = 0; i < ali.length; i++) { //Mouse overAli[i].onmouseover =function () { This. className = "hover" }; //Mouse AwayAli[i].onmouseout =function () { This. ClassName = ""; }; //Mouse clickAli[i].onclick =function() {oselect.innerhtml= This. InnerHTML}} Document.onclick=function() {OSub.style.display= "None"; };};</script>Show the coordinates you clicked
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">pre{color:green;padding:10px 15px;background: #f0f0f0; border:1px dotted #333;font:12px/1.5 Courier New;} Span{color: #999;}</style><script type= "Text/javascript" >Document.onclick=function(event) {varEvent = Event | |window.event; Alert ("Coordinates: [" + Event.clientx + "," + Event.clienty + "]")}</script>gt; varEvent = Event | |window.event; Alert ("Coordinates: [" + Event.clientx + "," + Event.clienty + "]")</script></pre></body>The user presses the keyboard to display the KeyCode
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">body{Text-Align:center; font:30px/1.5 \5fae\8f6f\96c5\9ed1, Arial;}pre{color:green;padding:10px 15px;background: #f0f0f0; border:1px dotted #333;font:12px/1.5 Courier New;text-align:left;} Span{color: #999;}</style><script type= "Text/javascript" >window.onload=function (){ varOP = document.getElementsByTagName ("P") [0]; Document.onkeydown=function(event) {varEvent = Event | |window.event; Op.innerhtml=Event.keycode; return false }}</script>Gt;window.onload=function (){ varOP = document.getElementsByTagName ("P") [0]; Document.onkeydown=function(event) {varEvent = Event | |window.event; Op.innerhtml=Event.keycode; return false }}</script></pre><p> here will show you press the key keycode</p></body>Simulate select control && show clicked coordinates && user presses the keyboard to display KeyCode