Answer the question
In order to leave comments, you need to log in
Why does the element not appear on the page when clicked?
Good afternoon.
I want to implement select through input radio.
.filter
.filter__form
.filter__form-group
h4.filter__title Tipologia
.select
.select__item
input(id="select1" type="radio" value="residentiali" name="residentiali" checked="checked")
label(for="select1") Residentiali
.select__item
input(id="select2" type="radio" value="commerciali" name="commerciali")
label(for="select2") Commerciali
.filter__form-group
h4.filter__title Zona
.select
.select__item
input(id="select3" type="radio" value="tutte" name="tutte" checked="checked")
label(for="select3") Tutte
.select__item
input(id="select4" type="radio" value="testo1" name="testo1")
label(for="select4") Testo1
.filter__form-group
h4.filter__title Contratto
.select
.select__item
input(id="select5" type="radio" value="vendita" name="vendita" checked="checked")
label(for="select5") Vendita
.select__item
input(id="select6" type="radio" value="testo2" name="testo2")
label(for="select6") Testo2
input[type="radio"] {
display: none;
&:checked + label {
display: block;
}
}
&__item {
&.active {
label {
display: block;
}
}
}
let showSelect = function () {
$('.filter__form .select').on('click', function () {
let selectItem = $(this).find('.select__item');
console.log(selectItem.hasClass('active'));
if (selectItem.hasClass('active') === false) {
selectItem.addClass('active');
} else {
selectItem.removeClass('active');
}
});
};
showSelect();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question