My page isnt doing what i programmed the javascript to do is know the code i correct if i call expand() it works but not check()
function check(i) {
if (document.getElementById(i).style.visibility == "hidden") {
expand(i);
} else {
collapse(i);
}
}
function expand(i) {
document.getElementById(i).style.visibility = "visible";
}
function collapse(i) {
document.getElementById(i).style.visibility = "hidden";
}
<div id="brand" onclick="check('brand-show')"> brand </div>
<div class="brand-show" id="brand-show" style="visibility: hidden">dcdv</div>
<div id="brand" onclick="check('brand-show')"> brand </div>
<div class="brand-show" id="brand-show" style="visibility: hidden">dcdv</div>
Please help i cant get the onlick to work in django for some reason.