check if a selector exists jquery code example Example: jQuery exists function if ($("#myElementID").length){ //I exist }