第1个回答 2011-10-13
document.getElementById("id_name").value
或者
docuemt.getElementById("id_name").innerHTML
如:
<html>
<head>
<title> New Document </title>
</head>
<script type="text/javascript">
function getValue()
{
var v = document.getElementById("username");
alert(v.value);
}
</script>
<body>
<form>
username:<input type="text" id="username"/>
<input type="submit" value="submit" onclick="getValue()"/>
</form>
</body>
</html>