- Individual refinements can be selected and de-selected by the user by clicking on the various checkboxes.
- When a panel has any number of facets selected, “clear” button needs to be shown.
- When any panel has any facets selected, a “clear all” button needs to be shown at the top of the refinements controls.
so based on my getElementById
I should be able to achieve this, but I'm not able myself.
// 'Getting' data-attributes using getAttribute
var size = document.getElementById('size');
var base = document.getElementById('base_colour');
var brand = document.getElementById('brand');
//When a panel has any number of facets selected, a “clear” button needs to be shown
$('input').on('click', function(){
if ($('.option input:checkbox:checked').length > 0) {
// any one is checked
}
else {
// none is checked
}
});