Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  11] [ 4]  / answers: 1 / hits: 40279  / 8 Years ago, sun, august 7, 2016, 12:00:00

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.


More From » jquery

 Answers
10

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



function display() {
$(#Contentable).hide();
$(#savebtn).hide();
$(#stylebar).hide();
}

[#61116] Thursday, August 4, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
darennevina

Total Points: 422
Total Questions: 128
Total Answers: 105

Location: Comoros
Member since Tue, Mar 14, 2023
1 Year ago
;