JavaScript
Article

Dynamic Update of Alt Tags on Hover

By Sam Deering

Proof of concept for changing alt tags/title tags on hover dynamically it gets picked up automatically by browsers and displayed as the usual “alt/title tooltip”. There is obviously no benefit to SEO using this but was good to prove it works. Check out me fiddle below.

dynamic-alt-tags

jsfiddle.net/a4yBR/

Browser support:
Latest chrome – yes
Latest firefox – yes
IE9 – yes
IE8 – ??

Free Guide:

7 Habits of Successful CTOs

"What makes a great CTO?" Engineering skills? Business savvy? An innate tendency to channel a mythical creature (ahem, unicorn)? All of the above? Discover the top traits of the most successful CTOs in this free guide.

  • Andy Harvey

    This markup could be simplyfied with the use of html5 attribute data-*

    For example: 3
    And using jQuery like this: $(‘span[data-dynalt]’);

    Just an idea.

    • Andy Harvey

      My markup disappeared. Retry :

      3

Recommended
Sponsors
Because We Like You
Free Ebooks!

Grab SitePoint's top 10 web dev and design ebooks, completely free!

Get the latest in JavaScript, once a week, for free.