标签:
<div class="textbox02">
<foreach name="conf_list" item="vos">
<p><input type="checkbox" class="config" name="config" value="{$vos.cf_id}" >{$vos.content} <span>{$vos.price}</span>元</p>
</foreach>
</div>
<a href="javascript:;" id="employ">提交</a></span>
<script>
$(function() {
$(‘#employ‘).on(‘click‘, function () {
var arr = new Array();
var i = 0;
$(‘.config‘).each(function(){
arr[i] = $(this).val();
i = i+1;
})
alert(arr);
});
});
</script>
取input中class相同的value(用于后台遍历较多)
标签:
原文地址:http://www.cnblogs.com/yangling520/p/5504400.html