This is what i am trying to get as result.
$(document).ready(function() {
$('.i_filter').change(function(e) {
e.preventDefault();
$('.i_filter:checked').each(function() {
var ele = [];
ele = $(this).val();
if ($('.i_filter').is(':checked')) {
jQuery.ajax({
url: 'filter_product.php',
type: 'POST',
data: {
ele: ele
},
success: function(data) {
$("#filter_result").html(data);
}
});
} else {
alert('Hello');
jQuery.ajax({
url: 'allproduct.php',
type: 'POST',
data: {},
success: function(data) {
$("#filter_result").html(data);
}
});
}
});
});
});
I want some data when check box is checked and after unchecked all the check boxes all data will be display in the div.
This system i want for creating shopping site filter using checkbox.