Hello.
I have this problem. There is a menu:
<ul id="menu"> <li id="1">Ссылка1<span class="list1">[<span id="list1">0</span>]</span></li> <li id="2">Cсылка2<span class="list1">[<span id="list2">0</span>]</span></li> <li id="3">Ссылка3<span class="list1">[<span id="list3">0</span>]</span></li> <li id="4">Ссылка4<span class="list1">[<span id="list4">0</span>]</span></li> <li id="5">Ссылка5<span class="list1">[<span id="list5">0</span>]</span></li> </ul> Do not tell me how to verify the menu item with all the clicked? If it is, then assign it a certain value.
$('li').click(function() { var current = $(this); // текущая позиция var id = current.attr('id'); // текущий id var str = "#list"+ id; var number = parseInt($(str).text()); // изменение индекса Here's how to search the entire list? If the current (pressed) id coincides with any of the menus, then perform certain actions.