Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Sep 2009
Posts: 13
Reputation: jaimca is an unknown quantity at this point 
Solved Threads: 0
jaimca jaimca is offline Offline
Newbie Poster

List Items

 
0
  #1
27 Days Ago
HI,


I am dynamically generating a unordered list. I want to get value("somevalue") inside each <li> item. How can i access it please help me.

<ul>
<li value="somevalue" > item1 </li>
<ul>

Help me in using javascript or jsp to do the above.. thanx in advance
Last edited by jaimca; 27 Days Ago at 6:29 am.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 849
Reputation: pritaeas will become famous soon enough pritaeas will become famous soon enough 
Solved Threads: 138
Sponsor
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Practically a Posting Shark
 
0
  #2
25 Days Ago
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <html>
  2. <head>
  3. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
  4. <script type="text/javascript">
  5. $(document).ready(function() {
  6. $("li").each(function(i) {
  7. alert($(this).attr("value"));
  8. });
  9. });
  10. </script>
  11. </head>
  12. <body>
  13. <ul>
  14. <li value="1">item 1</li>
  15. <li value="2">item 2</li>
  16. <li value="3">item 3</li>
  17. </ul>
  18. </body>
  19. </html>
"If it is NOT source, it is NOT software."
-- NASA
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC