$(".check-groupe").change(function () { related = $(this).attr("data-related"); operation = $(this).prop("checked"); console.log(related); console.log(operation); $.post( pathAjaxUpdate, {related:related, operation:operation}, function( data ) { console.log(data); }).fail(function(response) { console.log(response.responseText); }); //$("input:checkbox").prop('checked', $(this).prop("checked")); });