There is a code
<ul> <li> <ul> <li>text</li> <li>text</li> <li>text</li> </ul> </li> <li> <ul> <li>text</li> <li>text</li> <li>text</li> </ul> </li> </ul> It is necessary to determine the height of the initial and when you click to set it. Now the code is
height = "тут должна быть изначальная высота элемента"; $('ul > li > ul').css('height','0px'); $('ul > li').click(function() { $(this).children('ul').animate().css('height',height); }); How can I record the height of elements without creating different variables?
height = $('ul > li > ul').css('height')- Grundy