<!DOCTYPE?html>
<html>
<head>
<meta?charset="utf-8">
<script?type="text/javascript">
var?number=new?Array[1000][10];
number[1000][10]=[[123456,1111],[123457,2222]];
function?search(){
?????var?key=document.getElementById("number").value;
for(var?i=0;i<1000;i++){
for(var?j=0;j<2;j++){
if(number[i][j]==key){
alert("密碼:"+number[i][j+1]);
}
else{
?alert("對不起,未找到密碼!");
}???????
}
}
</script>
<style?type="text/css">
body{
margin:0;
}
????header{
???? width:?100%;
???? height:?40px;
???? padding:?30px?10px;
???? color:?#fff;
????????background-color:?#000;
????}
????span{
???? margin-left:?30px;
???? font-size:?40px;
????}
a{
text-decoration:none;
font-size:40px;
color:?#fff;
}
section{
width:?100%;
height:?100px;
margin-top:?400px;
padding:5px;
font-size:?50px;
text-align:?center;
}
input{
width:?220px;
height:?60px;
border:1px?solid?black;
}
</style>
</head>
<body>
<header>
<span>?<a?href="index.html"><back</a> 查?詢</span>
</header>
<section>請輸入車牌號<br/><br/>
<form>
<input?type="text"?id="number">
<button?id="search"?name="查詢"?onclick="search()">
</form>
</section>
</body>
</html>
哪里出錯了,為何實現不了函數search的功能
WentworthPeach
2017-02-03 14:32:51