$("p", "body#seniors #text")[2]. does not mean "third paragraph"
"nth-child" would be what you could use http://docs.jquery.com/Selectors/nthChild#index On Jul 13, 3:09 pm, Matthew <mvbo...@gmail.com> 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)? > > If I have the wrong syntax, how would I access the $("p", > "body#seniors #text") array at different indexes? > > Thanks, > Matthew