Get and show element - Node.js DOM

Node.js examples for DOM:Element

Description

Get and show element

Demo Code

// Gets a element by its Id. Used for shorter coding.
function GetE( elementId )
{
  return document.getElementById( elementId )  ;
}

function ShowE( element, isVisible )
{
  if ( typeof( element ) == 'string' )
    element = GetE( element ) ;//ww  w. j a  v  a2  s .co m
  element.style.display = isVisible ? '' : 'none' ;
}

Related Tutorials