Revision: 28455
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at July 8, 2010 17:29 by omerta83
Initial Code
$(document).ready(function() { //Let's set the background color of the nearest //UL in this pseudo-menu $('li.subchild').closest('ul').css('background-color', 'red'); }); // Example /* <ul> <li>Parent Menu <ul> <li class="subchild">Child Item 1</li> <li class="subchild">Child Item 2</li> </ul> </li> </ul> */
Initial URL
Initial Description
Initial Title
How to find closest element to another
Initial Tags
javascript, jquery
Initial Language
JavaScript