JavaScript element exists

This is a JavaScript Function to check if an element exists, I use it regularly in an If.

The function:

The test:

Our result:

We could see it works as it should.

4 thoughts on “JavaScript element exists”

  1. Hi I am so glad I found your blog, I really found you by
    accident, while I was looking on Yahoo for something else, Anyhow I am
    here now and would just like to say thanks
    for a marvelous post and a all round entertaining blog (I also
    love the theme/design), I don’t have time to read it all at the moment
    but I have bookmarked it and also included your RSS feeds,
    so when I have time I will be back to read
    more, Please do keep up the excellent jo.

    View Comment

Leave a Reply

Your email address will not be published.

seventeen − one =