View Full Version : Change word upon mouseover.
drluv888
06-28-2011, 04:23 AM
Hi All,
I'm just looking for a way to change a word in a sentence upon mouseover that word.
Any help'd be appreciated.
djr33
06-28-2011, 04:46 AM
You can apply a rollover effect like with images. Use a <span> and use onmouseover to change the innerHTML. If you need to change it back, use onmouseout the same way.
Do you just want a place to start or do you need someone to write this for you?
Also, do you want this to be a quick version that works once? Or will you use it in many places on your page? (Harder to setup that way, but more efficient.)
Doing what djr33 said, use the following code. http://jsfiddle.net/nile/Z83nA/
drluv888
07-05-2011, 09:38 PM
I'm getting a strange error: /dk/:8Uncaught TypeError: Cannot read property of 'dataset' of underfined.
What would be the quick way to do use it just once? (As in, only one <span> is changeable). I only need it in one place.
http://jsfiddle.net/Z83nA/5/
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.