the following is the examples

   <span id="test">test text</span>
   <span id="btnAddAnswer" style="display:none;"></span>
   $('btnAddAnswer').previous(0); -> test

now if the first "span"  was changed to "li"

     <li id="test">test text</li>
    <span id="btnAddAnswer" style="display:none;"></span>
    $('btnAddAnswer').previous(0); -> undefined

if it was changed like this:

     <li id="test">
          <p id="testp">test text</p>
     </li>
    <span id="btnAddAnswer" style="display:none;"></span>
   $('btnAddAnswer').previous(0); -> testp

I want only to get the value:li#test.
What should i do?
And Why was there such a phenomenon

thanks!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to