My question here is it really valid for a title attribute to hold html tags like break tag for new line.
<a href="#" title="hello <br> how are you" target="xxx"></a>
If its valid then break tag shows in tool tip which i want to avoid but still need a new line.
I am using jQuery.
I referred a link http://jsfiddle.net/roXon/N8Q2z/ in which i gave break tags in title. It just works fine in achieving new line without break tag being displayed in tool tip.
But not sure which part of the code is avoiding break tags in tool tip.
Can you please let me know which piece of code in jquery actually avoids break tags being displayed in tool tips as i am new to jquery.
Would appreciate all your help!!
Thanks in advance...
Try using <br />
but use the values <
for <
and >
for >
. This will means that when the title
is put into your tooltip it will be the correct format, and its valid!
Tested in IE7+, Chrome, Firefox.
jsFiddle
<a title="hello<br/>how are you" class="printbtn" href="#">Print results</a><br>
Attribute values cannot contain tags. You can put new lines in the attribute values, but that's probably not a good idea.
It's a good time to think about why you want to put tags in the attribute and what you want to accomplish. I'm sure there are better ways.
Use
or 
<a href="#" title="hello how are you" target="xxx"></a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With