Javascript Tooltip / Posts /

Links in tooltip body?

I'm appending a tooltip link with jQuery $().append():

$('#mydiv').append('<a href="#help" class="tooltip" onmouseover="tooltip.pop(this, \'<p>Here is some help content. <a href="somelink.html">Click here</a> for more help.</p>\')">Help</a>');

Something happens when the somelink.html link is rendered and it breaks. If I remove the link, it works fine. What am I doing wrong here?
Sam  9 years ago   viewed: 3086    

1 Answer

The double quote symbols are overlapping and break the HTML syntax. 
You need to change <a href="somelink.html"> to <a href=\'somelink.html\'>
Milo   9 years ago


Your name*
(Optional. Used to modify this post afterwords)
+ =  

Ask your Own Question

  • If your question is related to the topic of this post, you can post your question to this page by clicking the "Post a reply" button at left;

  • When you want to start a new page for your question: