使用jquery修改下列代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<!-- 取票系统界面设计 -->
<form action="" method="post" id="f" onsubmit="return myFunction()">
<div id="ticketingsystem">
<div id="headerName">
取票系统
</div>
<div id="inputTitle">
请输入兑换码:
</div>
<div id="input">
<input id="inputCode" type="text">
</div>
<div id="button">
<input type="submit" onclick="qupiao()" value="取票">
<input id="chongxin" type="button" onclick="chongxinshuru()" value="重新输入">
</div>
</div>
</form>
</body>
<style>
body {
margin: 0px;
padding: 50px;
}
#ticketingsystem {
width: 450px;
height: 150px;
border: 2px solid rgb(83 145 253);
}
#headerName {
height: 48px;
background-color: rgb(183, 207, 249);
border-bottom: 2px solid rgb(83 145 253);
line-height: 48px;
text-align: center;
font-weight: 540;
font-size: large;
}
#inputTitle {
height: 48px;
width: 178px;
float: left;
border-right: 2px solid rgb(83, 145, 253);
border-bottom: 2px solid rgb(83 145 253);
line-height: 48px;
text-align: center;
font-weight: 540;
font-size: large;
}
#input {
height: 48px;
width: 270px;
border-bottom: 2px solid rgb(83 145 253);
float: left;
line-height: 45px;
}
#inputCode {
margin-left: 5px;
height: 30px;
width: 200px;
}
#button {
height: 50px;
line-height: 50px;
text-align: center;
}
</style>
<script>
var realCode = "99632570063166";
var inputCode = document.querySelector("#inputCode");
function qupiao() {
if (inputCode.value == realCode) {
alert("取票成功!");
} else if (inputCode.value == '') {
alert("请输入兑换码!");
} else if (inputCode.value != realCode) {
alert("兑换码不正确!");
}
}
function chongxinshuru() {
inputCode.value = "";
document.getElementById("inputCode").focus();
}
</script>
</html>