<input name="content[]" value="content1">
<input name="content[]" value="content2">
<script>
content = $("input[name='content[]']");
for (i=0; i < content.length; i++) {
content[i] = content[i].value;
}
content = content.toArray(); // ["content1", "content2"]
</script>
【js】获取表单name[]的数组
最新推荐文章于 2023-01-05 22:39:17 发布