timbukto
timbukto

Reputation: 9

How do I get ALT attributes for a onClick link?

Consider:

<a href="#" onClick="myFunction22()"><img src="images/icon-exit.png" width="34" height="34" alt="Exit Fullscreen"></a>

I want a hover ALT tag for this Onclick link saying... "Exit Fullscreen"

Upvotes: 0

Views: 67

Answers (3)

Thug Life
Thug Life

Reputation: 109

You can use the title attribute for this:

<a href="#" onClick="myFunction22()" title="Exit FullScreen"><img src="images/icon-exit.png" width="34" height="34" alt="Exit Fullscreen"></a>

Upvotes: 3

Shawn GameForreal
Shawn GameForreal

Reputation: 76

You could do this without involving a link

<img src="images/icon-exit.png" onclick="myFunction22()" width="34" height="34" title="Exit Fullscreen">

but in either case, just use title=

Upvotes: 1

Sadeed_pv
Sadeed_pv

Reputation: 565

You can use the title attribute of the a tag like this:

  <a title="hello" href='/'>
    Hello world
  </a>

Upvotes: 1

Related Questions