javascript如何取到这里面的值<input type="hidden" name="test[a]" value = "1" />
<inputtype="hidden"name="test[a]"value="1"/><inputtype="hidden"name="test[b]"value="2...
<input type="hidden" name="test[a]" value = "1" />
<input type="hidden" name="test[b]" value = "2" />
<input type="hidden" name="test[c]" value = "3" />
<html>
<head>
<title>test1</title>
<script>
function get(){
var test = document.getElementByName("test[a]")[0].value;
alert(test);
}
</script>
</head>
<body>
<input type="hidden" name="test[a]" value = "1" />
<input type="hidden" name="test[b]" value = "2" />
<input type="hidden" name="test[c]" value = "3" />
<input type="hidden" name="test[d]" value = "4" />
<input type="hidden" name="test[e]" value = "5" />
<input type="hidden" name="test[f]" value = "6" />
<input type="hidden" name="test[g]" value = "7" />
<input type="hidden" name="test[h]" value = "8" />
<a href="javascript:get();">get</a>
</body>
</html>
都不行啊 展开
<input type="hidden" name="test[b]" value = "2" />
<input type="hidden" name="test[c]" value = "3" />
<html>
<head>
<title>test1</title>
<script>
function get(){
var test = document.getElementByName("test[a]")[0].value;
alert(test);
}
</script>
</head>
<body>
<input type="hidden" name="test[a]" value = "1" />
<input type="hidden" name="test[b]" value = "2" />
<input type="hidden" name="test[c]" value = "3" />
<input type="hidden" name="test[d]" value = "4" />
<input type="hidden" name="test[e]" value = "5" />
<input type="hidden" name="test[f]" value = "6" />
<input type="hidden" name="test[g]" value = "7" />
<input type="hidden" name="test[h]" value = "8" />
<a href="javascript:get();">get</a>
</body>
</html>
都不行啊 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询