check if element is in DOM jquery code example Example: jQuery exists function if ($("#myElementID").length){ //I exist }