Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
<ul id="ui1" class="uielement" runat="server">
  • <asp:Label ID="Label1" runat="server" Text="Item 1">

  • <asp:Label ID="Label2" runat="server" Text="Item 2">

  • <asp:Label ID="Label3" runat="server" Text="Item 3">

  • <asp:Label ID="Label4" runat="server" Text="Item 4">

  • <asp:Label ID="Label5" runat="server" Text="Item 5">





Respcted sir,
I m making my project in asp.net 3.5 and I want to get all element inside ul element by anyway by using javascript,jquery......anything
thank you sir
Posted
Updated 23-Jan-13 2:41am
v2

In this case $('#ui1 li') should do the trick.
If you want to loop through the items and process them then $('#ui1 li').each(function(){})
 
Share this answer
 
Comments
Monjurul Habib 16-Feb-13 13:20pm    
5+
Hi,
You can try this as well:
JavaScript
$("#ui1").children().each(function () {
  alert($(this).text());
});

With jQuery children function you can get any element inside you ul tag.

I hope this will help.
Thanks :)
 
Share this answer
 
Comments
Monjurul Habib 16-Feb-13 13:20pm    
5+
Sk. Tajbir 16-Feb-13 13:53pm    
Thanks :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900