Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2012
    Posts
    137
    Thanks
    1
    Thanked 1 Time in 1 Post

    How to use element content in jQuery function

    Hello,

    This is probably fairly trivial but I am trying to create a simple custom tooltip. When a user hovers over the code below I want to grap the html content, in this case the 'IO'. Does anyone know how to do this with jQuery?

    Code:
    <a class="glossaryLink" href="#" onmouseover="onRollOverPULink(this);" onmouseout="onRollOutPULink(event);" onclick="showHideGlossary('IO')">IO</a>

  • #2
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,913
    Thanks
    56
    Thanked 545 Times in 542 Posts
    I don't know what any of that other stuff does, but to set the title dynamically you can do this:

    Code:
    <a class="glossaryLink" href="#" onmouseover="this.title=this.innerHTML; onRollOverPULink(this);" onmouseout="onRollOutPULink(event);" onclick="showHideGlossary('IO')">IO</a>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •