how to find closest parent class in jquery code example
Example 1: jquery closest
$( "li.item-a" )
.closest( "ul" )
.css( "background-color", "red" );
Example 2: select parent of element jquery
$(this).parent(); // jquery
Example 3: jquery get closest form
$( this ).closest( "form" )
Example 4: jquery find parent closest by id child
$( "li.item-a" )
.closest( "ul" )
.css( "background-color", "red" );