jquery if id exist code example
Example: check element exist in jquery
if ($('.element').length) {
// there is at least one element matching the selector
}
if ($('.element').length) {
// there is at least one element matching the selector
}