how to check element is exist in jquery code example
Example 1: check element exist in jquery
if ($('.element').length) {
// there is at least one element matching the selector
}
Example 2: jQuery exists function
if ($("#myElementID").length){
//I exist
}