<!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>
<script type="text/javascript">
function aa()
{
var element=document.getElementById("st");
alert(element.value);
}</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<input id="st" name="st" value="ster"/>
<input type="submit" name="button" id="button" value="提交" onClick="aa()">
</form>
</body>
</html> 代码没问题
是你没调用,你这样试试
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
function aa()
{
var element=document.getElementById("st");
alert(element.value);
}</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<input id="st" name="st" value="ster"/>
<input type="submit" name="button" id="button" value="提交" onClick="aa()">
</form>
</body>
</html> 代码没问题
是你没调用,你这样试试
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货