JS获取输入框的值问题
<html><head>
<title>1</title>
<script type="text/javascript">
function vali(){
var in = document.getElementById("in").value;
alert(in);
}
</script>
</head>
<body>
<input type="text" id="in" value="moren"/>
<input type="button" value="正则测试" onClick="vali()" id="butt"/>
</body>
</html>
上面的代码为什么输不出输入框的值?