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 3:40am
Edited 23-Jan-13 3: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 OriginalGriff 274
1 Sergey Alexandrovich Kryukov 255
2 Shweta N Mishra 216
3 PIEBALDconsult 200
4 BillWoodruff 174
0 OriginalGriff 7,630
1 Sergey Alexandrovich Kryukov 7,022
2 DamithSL 5,586
3 Manas Bhardwaj 4,946
4 Maciej Los 4,525


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 23 Jan 2013
Copyright © CodeProject, 1999-2014
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