I have multiple, and I want to get the value, the attributes of each selected checkboxes.
<input type="checkbox" name="access[]" id="configuration" value="configuration" data-text="Configuration"> Configuration
<input type="checkbox" name="access[]" id="department" value="department" data-text="Departments"> Departments
I want to get all selected checkbox and store it to an array and push it to ajax
var classids = checkboxes.map(function(){ return $(this).attr("id"); }).get();
var val = checkboxes.map(function(){ return $(this).val(); }).get();
var datatext = checkboxes.map(function(){ return $(this).attr("data-text"); }).get();
How can I combine the three to make it one? Thanks in advance