小鹏_ing
2016-11-26 18:35
就是用户在输入框输入自己要打开的地址,然后就打开相应的地址?这个怎么弄
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>打开网址</title>
</head>
<style type="text/css">
body{text-align: center}
</style>
<script type="text/javascript">
function openwin(){
var add=document.getElementById("address").value;
window.open("http://"+add,"_blank");
}
</script>
<body>
<input type="text" value="请输入网址" size="50" id="address"/>
<input type="button" value="新窗口打开网站" onclick="openwin()" />
</body>
</html>
k_open = prompt("请输入你要打开的网页:","http://www.imooc.com");
window.open("k_open","_blank","width=400","height=500","menubar=no","toolbar=no")
JavaScript入门篇
739817 学习 · 9566 问题
相似问题