Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Javascript HTML jQuery
<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 Maciej Los 589
1 OriginalGriff 379
2 CPallini 205
3 RyanDev 175
4 Sergey Alexandrovich Kryukov 160
0 OriginalGriff 5,689
1 Sergey Alexandrovich Kryukov 4,783
2 Peter Leow 2,954
3 Maciej Los 2,819
4 DamithSL 2,465


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