Skip to content

Instantly share code, notes, and snippets.

@remoharsono
Created December 20, 2012 07:50
Show Gist options
  • Select an option

  • Save remoharsono/4343616 to your computer and use it in GitHub Desktop.

Select an option

Save remoharsono/4343616 to your computer and use it in GitHub Desktop.
In case you do not have jQuery or any other library, just this to check whether an element is exist or not taken from http://stackoverflow.com/questions/5629684/javascript-check-if-element-exists-in-the-dom
var element = document.getElementById('elementId');
if (typeof(element) != 'undefined' && element != null)
{
// exists.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment