cosmo cosmo - 1 year ago 105
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.

Answer Source

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

function display() {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download