PrateekSaxena Posted February 24, 2007 Share Posted February 24, 2007 Hello,I am planning to write a function in JavaScript that would check if a <DIV> of a particular ID exists or not. I was thinking that is there a property of a div that would be present even before setting it. Like, even if I don't write "position:relative" will it still be relative by default or absolute or something. I can check if this default info exists and then can return whether the whole <DIV> exsists or not! Link to comment Share on other sites More sharing options...
Andrew K. Posted February 24, 2007 Share Posted February 24, 2007 if(document.getElementById('id')) { //do whatever } Should work just fine. Link to comment Share on other sites More sharing options...
PrateekSaxena Posted February 24, 2007 Author Share Posted February 24, 2007 Ah! that was too simple...I was planngin to....Oh...never mind thanks Andrew Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now