onclick传递对象
作者:互联网
1 var data= [{name:'急', value:'28'},{name:'轻', value:'47'},{name:'中', value:'6'},{name:'重', value:'35'},{name:'其他', value:'4'}]; 2 3 4 <button type="button" class="layui-btn layui-btn-xs" onclick="report(' + JSON.stringify(data).replace(/"/g, '"')+')">导出</button>
获取到参数后,console.log()是这样的:
标签:console,name,对象,47,28,value,传递,35,onclick 来源: https://www.cnblogs.com/zhsoooz/p/16257385.html