LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Jquery not select text from second node (https://www.linuxquestions.org/questions/programming-9/jquery-not-select-text-from-second-node-783464/)

lindylex 01-20-2010 06:46 AM

Jquery not select text from second node
 
Code:

  $(xml).find("performance_0").each(function()
  {
   
        alert ($(this).find("the_images").eq(0).text());
       
  });

Here is the xml.

Code:

<Motion_Design_Images>
  <performance_0> 
                <the_images>
                        <img>sasha_n_lex_PEX_01.jpg</img>
                        <img>sasha_n_lex_PEX_02.jpg</img>
                        <img>sasha_n_lex_PEX_03.jpg</img>
                </the_images>
                <Date>2009/October</Date>
                <title>PEX Halloween 2009</title>
                <description>This is a description</description>
                <who_performed>Sasha and Lex</who_performed>
  </performance_0>

</Motion_Design_Images>

I want "sasha_n_lex_PEX_02.jpg" but i am unsure why I get the following instead.

Code:

                        sasha_n_lex_PEX_01.jpg
                        sasha_n_lex_PEX_02.jpg
                        sasha_n_lex_PEX_03.jpg



All times are GMT -5. The time now is 07:50 PM.