标签: javascript
我试图获取输入的值,但控制台显示“未定义”。我在做什么错了?
<input name = "foo" value = "value"> <script> var text = document.getElementsByName("foo").value; console.log(text); </script>