I have a Boolean variable. It is stored in a hidden input field. Basically, if the user is signed in, it is false
, if not, it is true
.
Ther
Loop through each div
that contains your download button and set hidden
to true
:
if (document.getElementById('download_btn_var_input').value == "true") {
var button_divs_array = document.getElementsByClassName('project_download_btn');
for (var i = 0; i < button_divs_array.length; i++) {
button_divs_array[i].hidden = true;
}
}