87,904
社区成员
发帖
与我相关
我的任务
分享
<script lanuage="javascript">
function tst()
{
var obj = document.getElementById('a1');
document.getElementById('a2').innerHTML = obj.value;
//这里写代码提交到后台,可以使用xmlhttp,具体可以搜索一下xmlhttp
}
</script>
<input type="text" name="a1" value="abc" /> <br />
<input type="submit" name="submit" value="提交" onclick="tst()"/>
<div id="a2"></div>
<head>
<script lanuage="javascript">
function ti()
{
alert(document.form1.user.value);
}
</script>
</head>
<body>
<form action="a.html" method="post" name="form1">
用户名: <input type="text" name="user" value="username" /> <br />
密 码 : <input type="password" name="pwd" /> <br /> <br />
性 别 : <input type="radio" value="男" checked="checked" name="sex" /> 男 <input type="radio" value="女" name="sex" /> 女 <br /> <br />
<input type="submit" name="submit" value="提交" onclick="ti()"/>
<input type="reset" name="reset" value="重置" />
</form>
</body>