jquery check if parent is div code example
Example: jquery if has parent
if ($(this).parents('.last').length) {
// element has an ancestor element with the class "last"
}
if ($(this).parents('.last').length) {
// element has an ancestor element with the class "last"
}