If I understood it correctly, I have to find the link's father element (parent()), then find the previous sibling (prev()), find its child (the other link) and finally check its text. However, this is not working...

ScallioXTX
—
2011-03-20T22:41:05Z —
#2

It works for me, but if it doesn't work for you it's probably because of the .children(). That returns a collection of nodes, and not just one node. So you might want to add .eq(0) after .children() to just get the first one

According to $(this).parent().prev().children().html()you're getting the html of all of the children, which is: "<a href="">Column 1</a>"

What about if you select the anchor from the context of that previous element, using:$('a', $(this).parent().prev()).html()

D3V4
—
2011-03-21T08:35:40Z —
#4

ScallioXTX said:

It works for me, but if it doesn't work for you it's probably because of the .children(). That returns a collection of nodes, and not just one node. So you might want to add .eq(0) after .children() to just get the first one