Grabbing Content of A Link (anchor)

Jonathan Simcoe's Avatar

Jonathan Simcoe

23 Mar, 2011 08:01 PM

So I am trying to use tipTip on an anchor link and use the link text (which is being indented via CSS, -9999px) to display in the tipTip popup and I need some help getting it working.

Here is what I have for markup:

`

<li class="commute"><a href="benchmarks.html#commute">Average Commute Time</a></li>
<li class="degree alt"><a href="benchmarks.html#degree" title="">Bachelor's Degrees Awarded per Capita</a></li>
<li class="math-science"><a href="benchmarks.html#math-science">Student Achievement in Math and Science</a></li>
`

And here is my jQuery:

`$(document).ready(function(){

$("#top-list li a").tipTip({content: $(this).html(), defaultPosition: "top", edgeOffset: 0, delay: 300});

});`

Any thoughts?

Cheers,

Jonathan

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac