Click here to Skip to main content
12,956,197 members (101,412 online)
Rate this:
 
Please Sign up or sign in to vote.
<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 23-Jan-13 2:40am
Updated 23-Jan-13 2:41am
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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(){})
  Permalink  
Comments
Monjurul Habib 16-Feb-13 13:20pm
   
5+
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Hi,
You can try this as well:
$("#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 :)
  Permalink  
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)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,849
CHill60 3,550
Maciej Los 3,223
ppolymorphe 2,060
Jochen Arndt 1,975


Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 23 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100