javascript获取文本框值
<%@LANGUAGE="VBSCRIPT"CODEPAGE="936"%><!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transiti...
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!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=gb2312" />
<title>无标题文档</title>
<script language="javascript">
function moumou(){
var mouren=wang.value;
var gezi=document.getElementById("hehe");
gezi.innerHTML=mouren;
}
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<input name="wang" type="text" id="wang" />
<input type="submit" name="Submit" value="提交" onclick="moumou();" />
</form>
<div id="hehe"></div>
</body>
</html>
以上是源代码,麻烦帮我改下怎么才能正常哈!
var mouren=wang.value;这句我是照书上写的,这样能不能获取到值?我不想改动这句,其他的帮我看看吧,谢了哈 展开
<!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=gb2312" />
<title>无标题文档</title>
<script language="javascript">
function moumou(){
var mouren=wang.value;
var gezi=document.getElementById("hehe");
gezi.innerHTML=mouren;
}
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<input name="wang" type="text" id="wang" />
<input type="submit" name="Submit" value="提交" onclick="moumou();" />
</form>
<div id="hehe"></div>
</body>
</html>
以上是源代码,麻烦帮我改下怎么才能正常哈!
var mouren=wang.value;这句我是照书上写的,这样能不能获取到值?我不想改动这句,其他的帮我看看吧,谢了哈 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询