1
I need to do some inputs on my form
of the mobile version are hidden and displayed by clicking on the button called Busca avançada
I created a code jQuery
but it’s not working I don’t know what I’m doing wrong remembering I’m using bootstrap 4
follow my codes:
HTML:
Type Reporting period 2 3 4 5 Number Year Choose a year 2 3 4 5 Search by term Fetch <button class="d-block d-sm-none advanced-btn" onclick="myFunction()">Busca avançada <i class="fas fa-caret-down"></i></button>
SCSS:
.advanced-btn{
border: 0;
background-color: transparent;
outline: none;
}
@media (max-width: $screen-xs-min) {
.myDIV{
display: none;
}
}
JS:
function myFunction() {
var x = document.getElementsByClassName("myDIV");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
It doesn’t close back ? I needed it to close up tbm
– Felipe Henrique
I edited the answer Kirito.
– LeAndrade
If the answer was useful to you, consider accepting it so that it can be closed on the site.
– LeAndrade