Snippets v2

Languages
My Snippets

Hide an Element using CSS Style Login or Register to Bookmark this snippet

Description Javascript

This function hides an element using the CSS 'display' style.

elm can be the id as string or object reference. Required xGetElementById (available on this site).

The Code Download
  1. function jHide(elm) {
  2.     //firstly check that elm is a reference or a text.
  3.     if(typeof(elm) == 'string') {
  4.         elm = xGetElementById(elm);
  5.     }
  6.     elm.style.display = 'none';
  7. }
Credits Contact JC

Added by JC on 11th November, 2007

Comments

There are no comments about this snippet.

Post Comment HTML is allowed

You must be registered and logged in to post a comment.

Login here to post a comment