<img title="<a href='#' onClick='alert('Hello World!')>The Link</a>" />
So I've got some specific question.. I already know that I can work with attributes inside a TITLE attribute.. But can I work with events inside a TITLE attribute?
(btw - It seems like a rubbish code, but this already works as is should on my web project - I just need a way to use some Javascript on this sheathed link.)
I USE Jquery framework.
This question is related to
javascript
html
tags
dom-events
When you click on the image you'll get the alert:
<img src="logo1.jpg" onClick='alert("Hello World!")'/>
if this is what you want.
no, you can't do that, but you can use event handlers to change the title:
<img src="foo.jpg" onmouseover="this.title='it is now ' + new Date()" />
Im my browser, this doesn't work at all. The tooltip field doesn't show a link, but <a href='#' onClick='alert('Hello World!')>The Link</a>
.
I'm using FF 3.6.12.
You'll have to do this by hand with JS and CSS. Begin here
<img title="<a href="javascript:alert('hello world')">The Link</a>" />
Source: Stackoverflow.com