在按钮单击时将多个值传递给弹出窗口

时间:2018-05-09 09:32:57

标签: jquery laravel

如何通过按钮将多个值传递给弹出窗口?

<button class="btn btn-success edit-company" data-id="{{ $cp->companyId }}" data-name="{{ $cp->companyName }}" data-nature="{{ $cp->businessNature }}" data-address="{{ $cp->companyAddress }}" data-zip="{{ $cp->companyZipcode }}" data-area="{{ $cp->companyAddressArea }}" data-email="{{ $cp->companyEmail }}" data-phone="{{ $cp->companyPhoneNumber }}" data-website="{{ $cp->companyWebsite }}">
  <i class="fa fa-edit m-right-xs"></i>
  Edit Profile
</button>

1 个答案:

答案 0 :(得分:0)

$('.edit-company').on('click',function(){
    var Name = $(this).data('name');
    // Here 'Name' will be having the value you passed to the popup
});