<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script>
function select(){
var data= document.getElementById("str").value
if (data=="" || data==undefined) {
alert('请输入查询的数据')
}
switch (data) {
case 'a':
window.location.href="\a.html"
break
case 'b':
window.location.href="\b.html"
break
default:
window.location.href="\c.html"
break
}
}
</script>
</head>
<body>
<div>
<input type="text" id="str">
<button onclick="select()">搜索</button>
</div>
</body>
</html>