Content of element as "content"

Joshua Works's Avatar

Joshua Works

03 May, 2010 10:49 PM

Is it possible to use the content of the hovered element (like $(this).html()) instead of an attribute of the element for the tooltip? How?

  1. 1 Posted by DHarnan on 17 Dec, 2010 03:42 AM

    DHarnan's Avatar

    Here is a solution for a hover event with custom content.


    function() {
            activation: "focus",
            defaultPosition: "right",
            delay: 0,
            content: $(this).children("div").html()
    function() {


  2. 2 Posted by Jorge Sandoval on 31 Jan, 2012 10:35 PM

    Jorge Sandoval's Avatar

    Great! thank you DHarnan!

  3. 3 Posted by Niacris on 20 May, 2013 01:26 PM

    Niacris's Avatar

    It would be better this way:

    $(".someClass").each(function() {
            delay: 0,
            content: $(this).children("div").html()

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


? 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