/    Sign up×
Community /Pin to ProfileBookmark

Firefox and underline span onmouseover?

Hi!
I have a span which includes some text..and I also have an image, what I simply want to do is to make so that the text in the span gets underlined once the mouse is over either the text or the image, and if its over the image it should underline the spans text..not the image…

What I simply did was connecting the onmouseover fuctions this js function..
where ID is the spans id…

function underlineme(id){
var idinc;
idinc = id;
idinc.style.textDecoration = “underline”;
}

The wierd thing is that this works great in IE, but doesnt works atall in Firefox….any ideas about what the problem could be?..

Its also worth to mention that the rest of the site is runned by an IIS server since Im using ASP.net…

Thanks in advance!

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@mrhooApr 29.2008 — Try

idinc = document.getElementById(id);

function underlineme(id){

document.getElementById(id).style.textDecoration = "underline";

}
Copy linkTweet thisAlerts:
@fatbob_51authorApr 29.2008 — doesnt work....just getting an error that says that the object aint specified...:S
Copy linkTweet thisAlerts:
@fatbob_51authorApr 29.2008 — Ok..I tried to change the color of the text inside the span aswell...by using

idinc.style.color='green';

it worked great in IE..but doesnt work at all in Firefox...it seems like the attribute "style" aint allowed in firefox or something:S....can anyone confirm that...or is there any smart "workaround"?
×

Success!

Help @fatbob_51 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...