jquery find parent up tree code example
Example 1: jquery closest
$( "li.item-a" )
.closest( "ul" )
.css( "background-color", "red" );
Example 2: jquery dom traversal parent
$( "li.item-a" ).parent().css( "background-color", "red" );
$( "li.item-a" )
.closest( "ul" )
.css( "background-color", "red" );
$( "li.item-a" ).parent().css( "background-color", "red" );