[jQuery] Help Traversing

2007-08-26 Thread atomicnuke

I hope this isn't a double post, my other one was over 12hrs ago and
it never displayed. I'm trying to get the text out of a  tag, I can
do this if I set an id name, but I don't want to id everything, since
with jQuery I don't need to. The premise is I'm clicking a link and it
gets two values and inserts them in a texarea. Inserting isn't the
problem, just finding the values.

$(document).ready(function(){
   $("#comments span h5 a").click(function(){
var author = $(this).parent("span").next("p").text();
alert(author);
})
 });


Minion(Reply)
Back to normal status



I'm finding the link, I had an alert test, so I know it works. So I
then tried to capture the data in the  tag. I just get a blank
alert though. I tried without the parent at first, but got nothing. So
thought I had to go up to the main tag before calling next, still
nothing. While on topic, is there a way to get the value of an id tag?
The number 5 will serve importance later.



[jQuery] Help Traversing

2007-08-26 Thread atomicnuke




$(document).ready(function(){
   $("#comments span h5 a").click(function(){
var author = $(this).parent("span").next("p").text();
alert(author);
})
 });





Minion(Reply)
Back to normal status



I'm trying to figure out how to grab the text between the  tags
when reply is clicked. I know I got the reply link targeted. I first
just had an alert, but tried going further. At first I just had $
(this).next("p").text(); but thought maybe I needed to go to the
parent, then move on, but it just shows a blank alert box.