As shown in the picture, when I click to open in batches, how can I use js code to get the id value in the box?
This form is read from the database The data is looped out,
<td class="center"><input class="aids" type="checkbox" name="ids[]"
value="{$val['id']}"></td>
This is the box code
我想大声告诉你2017-06-10 09:49:38
var id_list = [];
$(".btn").click(function(){
$(".aids").each(function(){
if($(this).is(":checked") == true) {
id_list.push($(this).val())
}
});
alert(id_list)
});
phpcn_u15822017-06-10 09:49:38
Brother, I see you again, Smile manually.jpg
<script>
$(document).ready(function() {
$("#click").click(function() {
var ids=[];
$("input[name=ids[]]:checked").each(function() {
ids.push($(this).val()); //push添加元素到数组末尾
});
alert(ids); //alert打印数组
});
});
</script>