Skip to content

This is how you can check whether the div exists:

if ( $("#message").length ) {
$('#message').text("Hello!");
}