javascript怎么输入第一个文本框中的数字按钮一下,从第二个文本框内输出代码实现
javascript怎么输入第一个文本框中的数字按钮一下,从第二个文本框内输出代码实现<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Tra...
javascript怎么输入第一个文本框中的数字按钮一下,从第二个文本框内输出代码实现
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<table width="528" border="1">
<tr>
<td width="268">请输入盒子的长:</td>
<td width="244"><form id="form1" name="form1" method="post" action="">
<label>
<input type="text" name="textfield" id="textfield" />
</label>
</form> </td>
</tr>
<tr>
<td>请输入盒子的宽:</td>
<td><form id="form2" name="form2" method="post" action="">
<label>
<input type="text" name="textfield2" id="textfield2" />
</label>
</form> </td>
</tr>
<tr>
<td>请输入盒子的高:</td>
<td><form id="form3" name="form3" method="post" action="">
<label>
<input type="text" name="textfield3" id="textfield3" />
</label>
</form> </td>
</tr>
<tr>
<td colspan="2" align="center"><form id="form4" name="form4" method="post" action="">
<label>
<input type="submit" name="button2" id="button2" value="提交" />
</label>
<label>
<input type="submit" name="button" id="button" value="重置" />
</label>
</form></td>
</tr>
<tr>
<td>你输入的盒子的长是:</td>
<td> </td>
</tr>
<tr>
<td>你输入的盒子的宽是:</td>
<td> </td>
</tr>
<tr>
<td>你输入的盒子的高是:</td>
<td> </td>
</tr>
</table>
</body>
</html> 展开
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<table width="528" border="1">
<tr>
<td width="268">请输入盒子的长:</td>
<td width="244"><form id="form1" name="form1" method="post" action="">
<label>
<input type="text" name="textfield" id="textfield" />
</label>
</form> </td>
</tr>
<tr>
<td>请输入盒子的宽:</td>
<td><form id="form2" name="form2" method="post" action="">
<label>
<input type="text" name="textfield2" id="textfield2" />
</label>
</form> </td>
</tr>
<tr>
<td>请输入盒子的高:</td>
<td><form id="form3" name="form3" method="post" action="">
<label>
<input type="text" name="textfield3" id="textfield3" />
</label>
</form> </td>
</tr>
<tr>
<td colspan="2" align="center"><form id="form4" name="form4" method="post" action="">
<label>
<input type="submit" name="button2" id="button2" value="提交" />
</label>
<label>
<input type="submit" name="button" id="button" value="重置" />
</label>
</form></td>
</tr>
<tr>
<td>你输入的盒子的长是:</td>
<td> </td>
</tr>
<tr>
<td>你输入的盒子的宽是:</td>
<td> </td>
</tr>
<tr>
<td>你输入的盒子的高是:</td>
<td> </td>
</tr>
</table>
</body>
</html> 展开
1个回答
展开全部
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="" onSubmit="return show();">
<table width="528" border="1">
<tr>
<td width="268">请输入盒子的长:</td>
<td width="244">
<label>
<input type="text" name="textfield" id="textfield" />
</label>
</td>
</tr>
<tr>
<td>请输入盒子的宽:</td>
<td>
<label>
<input type="text" name="textfield2" id="textfield2" />
</label>
</td>
</tr>
<tr>
<td>请输入盒子的高:</td>
<td>
<label>
<input type="text" name="textfield3" id="textfield3" />
</label>
</td>
</tr>
<tr>
<td colspan="2" align="center"><form id="form4" name="form4" method="post" action="">
<label>
<input type="submit" name="button2" id="button2" value="提交" />
</label>
<label>
<input type="reset" name="button" id="button" value="重置" />
</label>
</form></td>
</tr>
<tr>
<td>你输入的盒子的长是:</td>
<td id="as"> </td>
</tr>
<tr>
<td>你输入的盒子的宽是:</td>
<td id="bs"> </td>
</tr>
<tr>
<td>你输入的盒子的高是:</td>
<td id="cs"> </td>
</tr>
</table>
</form>
<script>
function show(){
document.getElementById("as").innerHTML = document.getElementById("textfield").value;
document.getElementById("bs").innerHTML = document.getElementById("textfield2").value;
document.getElementById("cs").innerHTML = document.getElementById("textfield3").value;
return false;
}
</script>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="" onSubmit="return show();">
<table width="528" border="1">
<tr>
<td width="268">请输入盒子的长:</td>
<td width="244">
<label>
<input type="text" name="textfield" id="textfield" />
</label>
</td>
</tr>
<tr>
<td>请输入盒子的宽:</td>
<td>
<label>
<input type="text" name="textfield2" id="textfield2" />
</label>
</td>
</tr>
<tr>
<td>请输入盒子的高:</td>
<td>
<label>
<input type="text" name="textfield3" id="textfield3" />
</label>
</td>
</tr>
<tr>
<td colspan="2" align="center"><form id="form4" name="form4" method="post" action="">
<label>
<input type="submit" name="button2" id="button2" value="提交" />
</label>
<label>
<input type="reset" name="button" id="button" value="重置" />
</label>
</form></td>
</tr>
<tr>
<td>你输入的盒子的长是:</td>
<td id="as"> </td>
</tr>
<tr>
<td>你输入的盒子的宽是:</td>
<td id="bs"> </td>
</tr>
<tr>
<td>你输入的盒子的高是:</td>
<td id="cs"> </td>
</tr>
</table>
</form>
<script>
function show(){
document.getElementById("as").innerHTML = document.getElementById("textfield").value;
document.getElementById("bs").innerHTML = document.getElementById("textfield2").value;
document.getElementById("cs").innerHTML = document.getElementById("textfield3").value;
return false;
}
</script>
</body>
</html>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询