php - js gets form id value
扔个三星炸死你
扔个三星炸死你 2017-06-10 09:47:38
0
2
729


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

扔个三星炸死你
扔个三星炸死你

reply all(2)
我想大声告诉你
var id_list = [];
$(".btn").click(function(){
    $(".aids").each(function(){
        if($(this).is(":checked") == true) {
            id_list.push($(this).val())
        }
    });
    alert(id_list)
});
phpcn_u1582

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>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template