在foreach或者each循环中给按钮赋予值 html中:data-key="@config.key" js里获取值: var key = $(this).data("key"); 转载于:https://www.cnblogs.com/dayang12525/p/7729717.html