..


Sponsored Links

How do I check if an element exists in the page?

And 'Just make sure if the call ID of the element returns "null" or not.
Here's an example: suppose we have to see if the page exists or not, an element with ID 'FOO':

 



 if (document.getElementById ('FOO')! = null)







 {



  



 alter ('OK');







 Else {}



  



 alert ('ID does not exist');







 }

 

In the same category ...
E-Learning
CSS (Course) CSS (Course)
Web Design and Accessibility according to W3C CSS and XHTML. Starting from 29 €.
HTML (Course) HTML (Course)
The markup language for the Web from 29 €.
Javascript (Course) Javascript (Course)
Complete guide to client-side scripting. From 39 €.
Sponsored Links