Forum : How to make elements invisible
Brief description  about Online courses   join in Online courses
View prabeen  patra 's Profile

How to make elements invisible

How can we make page elements invinsible using javascript...?
Asked by prabeen patra | Nov 4, 2009 |  Reply now
Replies (1)
View teacher siliconindia 's Profile
Hi Prabeen,

Elements can be made invinsible by changing the "visibility" attribute of the style object associated with your element. Remember that a hidden element still takes up space, use "display" to make the space disappear as well.

if ( x == y) {
myElement.style.visibility = 'visible';
} else {
myElement.style.visibility = 'hidden';
}
Nov 4, 2009