Search the web
Sign In
New User? Sign Up
phpexperts
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
jQuery :: How to select DOM elements under this   Message List  
Reply | Forward Message #12611 of 13237 |
Re: [phpXperts] jQuery :: How to select DOM elements under this

Hi Saiful

try this....

$("#test ul li").each(function(){
           $(this).children("a").attr("rel");
});

--
with regards

Jilani Jidni


On Thu, Jul 9, 2009 at 1:24 PM, $@!fulâ„¢ <anm.saiful@...> wrote:


<div id="test">
    <ul>
        <li><a rel="x" href="#">X</a></li>
        <li><a rel="y" href="#">Y</a></li>
        <li><a rel="z" href="#">Z</a></li>
    </ul>
</div>
 
$("#test ul li").each(function(){
    $(this).......
});
The $(this) will select a single li element.
Now i want to access the rel attribute of a element under the li (ie. $(this))
How it could be possible?
I need to get the value of rel attribute of each li.
 
My Web Site Feed Burner Twitter Linked In Face Book Yahoo
Messenger








Fri Jul 10, 2009 7:02 pm

jidni100
Online Now Online Now
Send Email Send Email

Forward
Message #12611 of 13237 |
Expand Messages Author Sort by Date

<div id="test">     <ul>         <li><a rel="x" href="#">X</a></li>         <li><a rel="y" href="#">Y</a></li>         <li><a rel="z"...
$@!fulâ„¢
anm.saiful
Offline Send Email
Jul 10, 2009
1:29 pm

Hi Saiful try this.... $("#test ul li").each(function(){ *$(this).children("a").attr("rel");* }); -- with regards Jilani Jidni ... Hi Saiful try this.......
Jilani Jidni
jidni100
Online Now Send Email
Jul 10, 2009
8:37 pm

Try with: $('#test ul li').each( function() {      $('a', this).attr('rel')  }); Hope this helps. Alligator_666 ... From: $@!ful™ <anm.saiful@...> ...
Alligator
alligator_666
Offline Send Email
Jul 16, 2009
5:55 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help