Demo For: jQuery Check Null (object exists or not) Examples

This is a DIV

NOTE: When the page is loaded, we are checking if a div with ID "test" exists or not and then alert the result. Additionally, we are going to check if IF "my_div" exists or not & then alert its result as well. So you should see 2 alerts when the page is loaded, each specifying their own results.