here is my a class Button in html, inside you can find the id with one value group_name. But I need to pass another variable $group_search_overview->groupsid to jquery.
@foreach($groups_search_overview as $group_search_overview)
<a class="btn btn-primary btn-block test_uebergabe" id="{{$group_search_overview->group_name}}">
{{$group_search_overview->group_name}}
</a>
@endforeach
This is my jquery script
$(document).on('click', '.test_uebergabe', function () {
var idgroups = $(this).attr("id");
$('.modal-body').html(idgroups);
$('#dataModal').modal({show: true});
});
How can I send a second variable to jquery? What's the correct way to do this?
Thanks.
dataattribute, to access these with jQuery use.data()