cosmo cosmo - 2 months ago 12
Javascript Question

"document.getElementById(div).style.display = none" not working

I'm trying to hide three divs when I click a button, but my js isn't working.

function display() {
document.getElementById("Contentable").style.display = none;
document.getElementById("savebtn").style.display = none;
document.getElementById("stylebar").style.display = none;

When I click the button there is an uncaught reference error that says "none" is not defined.


The none should be in " " and you can use JQuery for this as well.

function display() {