简单的javascript脚本 写一个网页:一个输入框一个按钮,点按钮时把文本框中的内容作为一个链接打开

来源:百度知道 编辑:UC知道 时间:2024/09/23 11:10:23
急求! 就是想不起来了 谢高人指点!

<html>
<head>
<script language="javascript">
function Open(){
var url = document.getElementById("url").value;
window.open (url);
}
</script>
</head>
<body>
<input type="text" id="url" value=" http://baidu.com"/>
<input type="button" value="submit" onclick="Open()">
</body>
</html>

<script type="text/javascript">
function gourl(){
if (document.getElementById('url').value!="" && document.getElementById('url').value!=null){
window.location.href = "http://" + document.getElementById('url').value;
}else{}
}
</script>
http://<input type="text" id="url" />
<input type="