closest jquery display variable in html code example Example: jquery closest $( "li.item-a" ) .closest( "ul" ) .css( "background-color", "red" );