how to get nearest div in jquery code example Example: jquery nearest $( "li.item-a" ) .closest( "ul" ) .css( "background-color", "red" );