Form input style ancestor element: focus (jQuery)
3 answers
The closest jQuery is also an option.
closest( selector )
.closest( selector )
.closest( selector, [ context ] )
closest( selectors, [ context ] )
.closest( selectors, [ context ] )
In the description .. Get the first ancestor element that matches the selector, starting at the current element and progressing through the DOM tree.
0
source to share