html制作,点击按钮1在prompt中输入文字,文本框显示网页地址,点击按钮2跳转到该网页
发布网友
发布时间:2022-05-07 20:21
我来回答
共1个回答
热心网友
时间:2023-11-09 21:22
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题</title>
<script type="text/javascript">
function setContent(){
var content = prompt("请输入","");
if (content!=null&&content!="") {
document.getElementById("text").value = content;
};
}
function clearContent(){
document.getElementById("text").value = "";
}
function jumpUrl(){
var jumpUrl = document.getElementById("text").value;
location.href = jumpUrl;
}
</script>
</head>
<body>
<input type="button" value="请输入" id="setContent" onclick="setContent()" />
<input type="button" value="清除" id="clearContent" onclick="clearContent()" />
<input type="text" name="text" id="text" />
<input type="button" value="go" onclick="jumpUrl()" />
</body>
</html>
热心网友
时间:2023-11-09 21:22
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题</title>
<script type="text/javascript">
function setContent(){
var content = prompt("请输入","");
if (content!=null&&content!="") {
document.getElementById("text").value = content;
};
}
function clearContent(){
document.getElementById("text").value = "";
}
function jumpUrl(){
var jumpUrl = document.getElementById("text").value;
location.href = jumpUrl;
}
</script>
</head>
<body>
<input type="button" value="请输入" id="setContent" onclick="setContent()" />
<input type="button" value="清除" id="clearContent" onclick="clearContent()" />
<input type="text" name="text" id="text" />
<input type="button" value="go" onclick="jumpUrl()" />
</body>
</html>
热心网友
时间:2023-11-09 21:22
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题</title>
<script type="text/javascript">
function setContent(){
var content = prompt("请输入","");
if (content!=null&&content!="") {
document.getElementById("text").value = content;
};
}
function clearContent(){
document.getElementById("text").value = "";
}
function jumpUrl(){
var jumpUrl = document.getElementById("text").value;
location.href = jumpUrl;
}
</script>
</head>
<body>
<input type="button" value="请输入" id="setContent" onclick="setContent()" />
<input type="button" value="清除" id="clearContent" onclick="clearContent()" />
<input type="text" name="text" id="text" />
<input type="button" value="go" onclick="jumpUrl()" />
</body>
</html>
热心网友
时间:2023-11-09 21:22
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题</title>
<script type="text/javascript">
function setContent(){
var content = prompt("请输入","");
if (content!=null&&content!="") {
document.getElementById("text").value = content;
};
}
function clearContent(){
document.getElementById("text").value = "";
}
function jumpUrl(){
var jumpUrl = document.getElementById("text").value;
location.href = jumpUrl;
}
</script>
</head>
<body>
<input type="button" value="请输入" id="setContent" onclick="setContent()" />
<input type="button" value="清除" id="clearContent" onclick="clearContent()" />
<input type="text" name="text" id="text" />
<input type="button" value="go" onclick="jumpUrl()" />
</body>
</html>
热心网友
时间:2023-11-09 21:22
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题</title>
<script type="text/javascript">
function setContent(){
var content = prompt("请输入","");
if (content!=null&&content!="") {
document.getElementById("text").value = content;
};
}
function clearContent(){
document.getElementById("text").value = "";
}
function jumpUrl(){
var jumpUrl = document.getElementById("text").value;
location.href = jumpUrl;
}
</script>
</head>
<body>
<input type="button" value="请输入" id="setContent" onclick="setContent()" />
<input type="button" value="清除" id="clearContent" onclick="clearContent()" />
<input type="text" name="text" id="text" />
<input type="button" value="go" onclick="jumpUrl()" />
</body>
</html>
热心网友
时间:2023-12-01 22:20
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题</title>
<script type="text/javascript">
function setContent(){
var content = prompt("请输入","");
if (content!=null&&content!="") {
document.getElementById("text").value = content;
};
}
function clearContent(){
document.getElementById("text").value = "";
}
function jumpUrl(){
var jumpUrl = document.getElementById("text").value;
location.href = jumpUrl;
}
</script>
</head>
<body>
<input type="button" value="请输入" id="setContent" onclick="setContent()" />
<input type="button" value="清除" id="clearContent" onclick="clearContent()" />
<input type="text" name="text" id="text" />
<input type="button" value="go" onclick="jumpUrl()" />
</body>
</html>
热心网友
时间:2023-11-09 21:22
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题</title>
<script type="text/javascript">
function setContent(){
var content = prompt("请输入","");
if (content!=null&&content!="") {
document.getElementById("text").value = content;
};
}
function clearContent(){
document.getElementById("text").value = "";
}
function jumpUrl(){
var jumpUrl = document.getElementById("text").value;
location.href = jumpUrl;
}
</script>
</head>
<body>
<input type="button" value="请输入" id="setContent" onclick="setContent()" />
<input type="button" value="清除" id="clearContent" onclick="clearContent()" />
<input type="text" name="text" id="text" />
<input type="button" value="go" onclick="jumpUrl()" />
</body>
</html>