<script>
var ary=[];
var ary1=[];
var json=[];
document.getElementById(‘sub_add‘).onclick=function(){
var shipNum=document.getElementsByClassName(‘shipNum‘);
for(var i=0;i<shipNum.length;i++){
ary.push(shipNum[i].getAttribute(‘data-id‘));
ary1.push(shipNum[i].getAttribute(‘data-num‘));
}
var json1={};
for(var a=0;a<ary.length;a++){
json1[a]=[ary[a],ary1[a]];
}
document.getElementById(‘hidden‘).value=json1;
}
</script>
时间: 2024-10-08 20:50:31