On Mon, 2009-07-13 at 12:09 -0700, Matthew wrote: > So it seems like everyday I learn a new way to code the same thing. > What I am trying to do is add some code after a paragraph depending on > how many paragraphs are in the content. I'm not to worried about logic > right now just syntax. Here is my code: > > > My questions is regarding this syntax: $("p", "body#seniors #text") > [2].append(something); > > Shouldn't that append something after the 3rd paragraph in the #text > div (if it exists)?
I believe the selector would grab all the paragraphs (that is your "p"), then add into the array the element of id "text" that lies within the body element with id of "seniors". The third element in that array is not necessarily a paragraph element. Perhaps you could scab together a little DOM for us to look at: <body id="seniors"> <div id="text"> etc. etc. Cheers, -- Matt Zagrabelny - mzagr...@d.umn.edu - (218) 726 8844 University of Minnesota Duluth Information Technology Systems & Services PGP key 1024D/84E22DA2 2005-11-07 Fingerprint: 78F9 18B3 EF58 56F5 FC85 C5CA 53E7 887F 84E2 2DA2 He is not a fool who gives up what he cannot keep to gain what he cannot lose. -Jim Elliot
signature.asc
Description: This is a digitally signed message part