Click here to Skip to main content
Rate this: bad
good
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
Edited 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 at 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 Smile | :)
  Permalink  
Comments
Monjurul Habib at 16-Feb-13 13:20pm
   
5+
Sk. Tajbir at 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
0 Sergey Alexandrovich Kryukov 668
1 OriginalGriff 396
2 Tadit Dash 345
3 sanket saxena 329
4 Peter Leow 203
0 Sergey Alexandrovich Kryukov 12,109
1 OriginalGriff 7,326
2 Peter Leow 5,013
3 Abhinav S 4,013
4 Maciej Los 3,575


Advertise | Privacy | Mobile
Web01 | 2.8.140421.2 | Last Updated 23 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid