On Oct 8, 10:31 am, "Hector Virgen" <[EMAIL PROTECTED]> wrote:
> Maybe there's a better way to approach my problem.
> I have a nested unordered list that contains an image (icon) and some text
> in each LI. I want to extract just the text part of the LI without the
> image.
>
> <ul>
>     <li id="foo"><img src="icon.png" alt="" />Foo</li>
>     <li id="bar"><img src="icon.png" alt="" />Bar
>         <ul>
>             <li id="baz"><img src="icon.png" alt="" />Baz</li>
>         </ul>
>     </li>
> </ul>
>
> What I want is extract 'Foo', 'Bar', and 'Baz' from each of the LIs. Any
> ideas on how to go about this, or should I restructure my html?

You want Tobie's "getInnerText" function [1]. We should think about
putting this into Prototype at some point.

Cheers,
Andrew

[1] http://tobielangel.com/2006/10/18/extending-prototype-getinnertext

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to