Tip: you can modify some code before running
<p><meta content="text/html;charset=gb2312" http-equiv="content-type" /></p><!--把下面代码加到<head>与</head>之间--><p><style type="text/css">* {Margin: 0; padding: 0; font: Arial 12px/18px;} # mySel {position: absolute; width: 200px;} # mySelInput {width: 174px; height: 20px; line-height: 20px; margin: 1px 0 1px 1px; border: 1px solid #696; border-right: 0; background: # fff; float: left ;} # mySelButton {margin: 1px 1px 0; width: 20px; height: 20px; border: 1px solid #696; background: # fff; float: left ;} # mySelOptions {list-style: none; width: 192px; margin: 0 1px; border: 1px solid #696; float: left; display: none;} # mySelOptions li {height: 20px; width: 192px;} # mySelOptions li a {width: 192px; height: 20px; line-height: 20px; text-decoration: none; color: #333; background: # fff; display: block;} # mySelOptions li a: hover {text-decoration: none; color: #933; background: # ccc ;}</style></p><!--把下面代码加到<body>与</body>之间--><div id="mySel"><input id="mySelInput" value="Please Select or Input a Value" type="text" /> <input id="mySelButton" type="button" value="v" /><ol id="mySelOptions"> <li>Google</li> <li>Baidu</li> <li>China WEB first stop</li></ol></div><script type="text/javascript">Var mySel = document. getElementById ("mySel"); var mySelInput = document. getElementById ("mySelInput"); var mySelButton = document. getElementById ("mySelButton"); var mySelOptions = document. getElementById ("mySelOptions"); var mySelOpts = mySelOptions. getElementsByTagName ("a"); for (I = 0, l = mySelOpts. length; I<l;i++){ mySelOpts[i].onclick = function(){ mySelInput.value = this.innerHTML; window.location=this.href; hideOptions(); return false; }}function showOptions () {mySelOptions.style.display='block';}function hideOptions () {mySelOptions.style.display='none';}document.onclick = function(e){var evt = e?e:window.event;var ele = evt.srcElement || evt.target;if(ele.id == 'mySelInput' || ele.id == 'mySelButton'){showOptions();}else{hideOptions();}}</script>
Tip: you can modify some code before running