如题。。昨天有人给我答案。了。。写上123456就会转到 baidu.com/123456.html ;但是我如果写的是654321并不会跳到baidu.com/654321.html
我需要的是输入什么东西就跑到baidu.com/输入的内容.html
以下是昨天帮助我的人提供的代码。
<input type="text" id="Sub" value="" />
<input type="button" onclick="Sub();" value="提交">
<script>
function Sub(){
var a=document.getElementById("Sub").value;
if(a=="123456"){
window.location.href = "http://zhidao.baidu.com/123456.html";
}
}
</script>
以上代码放入html页面中即可实现功能。