js 获取 input value

引用:http://foolraty.blog.163.com/blog/static/366588962010250721581/

<html>

<head></head>

<body>

<input type="text" id="123" name="213" value="2"/>

<script>

alert("111");

var a = document.getElementsByName("213")[0].value

alert(a);

</script>

</body>

</html>

posted @ 2011-10-13 20:50  镇水古月  阅读(761)  评论(0编辑  收藏  举报