rt,为什么我输出的是你想的数字是[object HTMLInputElement]
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>智障程序</title>
<script type="text/javascript" language="JavaScript" src="orz.js">
</script>
</head>
<body>
<div align="center">
<p>请输入你想的数字:</p>
<input type="text" name="text1" value="" id="text1" />
<br><br>
<input type="button" name="button1" value="提交" onclick="show();" id="button1"/>
</div>
</body>
</html>
function gets(id)
{
return document.getElementById(id)
}
function show()
{
var a=gets('text1');
alert("你想的数字是"+a);
}