Reputation: 862
I have a image tag inside an tag having title with html tags.
<a href="img_url" title="test #hashtag<br><a href='some_url'>More...</a>">
<img src="img_url" alt="" title="" border="0" align="center">
</a>
but while displaying the tag it displays with the tags. Is there a way to do this?
EDIT
What I am trying to accomplish here to render the title tag like plain html and not showing the tags. This is used in image library where I am using a jQuery plugin swipe-box which uses the title attribute of the tag to display as a caption So like yahoo gallery I want to link the image to the main article. Any ideas?
Upvotes: 0
Views: 4794
Reputation: 201896
So you are using a plugin that reads the title
attribute of an a
element and constructs a presentation where that value is used as a visible title for an image. And you want that value to contain an a
element, but you don’t want the markup to appear when the user mouses over the image
This is a feature of the plugin you are using. Modify it, or find a different plugin that suits your needs. If the visible title may need to contain HTML markup, a different approach is needed (unless you want the markup to be shown on mouseover). For example, you could make the plugin use data-title
(perhaps falling back to title
if data-title
is not present.
The title
attribute value is by definition just text (except that character references are interpreted), and this is how browsers treat it.
Upvotes: 1
Reputation: 6924
If I'm understanding you correctly, you want to render the contents of the title tag as HTML. That is not supported.
What exactly are you trying to accomplish here? If you want a tooltip containing HTML to show up, I would put your HTML into a hidden div and have your div show up above the cursor or link on hover.
Upvotes: 0