Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
119
rated 0 times [  124] [ 5]  / answers: 1 / hits: 121749  / 14 Years ago, sat, february 12, 2011, 12:00:00
function classInfo(e){
document.getElementById('classRight').setAttribute('display','none');
alert(e);
}


I think this code is very straightforward bit it's not working, and is not hiding the element in question. I am getting my alert, which makes me think there is no issue.



Any help would be appreciated.


More From » dom

 Answers
55

display is not an attribute - it's a CSS property. You need to access the style object for this:



document.getElementById('classRight').style.display = 'none';

[#93761] Friday, February 11, 2011, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jamaal

Total Points: 515
Total Questions: 102
Total Answers: 107

Location: France
Member since Thu, May 6, 2021
3 Years ago
;