<script>
function getValueUsingClass(){
/* declare an checkbox array */
var chkArray = [];
/* look for all checkboes that have a class 'chk' attached to it and check if it was checked */
$(".chk:checked").each(function() {
chkArray.push($(this).val());
});
/* we join the array separated by the comma */
var selected;
selected = chkArray.join(',') + ",";
/* check if there is selected checkboxes, by default the length is 1 as it contains one single comma */
if(selected.length > 1){
alert("You have selected " + selected);
}else{
alert("Please at least one of the checkbox");
}
}
</script>
<input type="button" value="Remove Selected" id="buttonClass">
<input type="checkbox" class="chk" value="<?php echo $_item->getId(); ?>">
我有一张包含多件物品的购物卡 如何从购物卡中删除所选项目?