/    Sign up×
Community /Pin to ProfileBookmark

Question about highlighting table cells on mouseover

I have a small table that contains a column and multiple rows that have text as links. In each row I have <td onMouseOver=this.syle.backgroundColor=’000000′”> as well as an onmouseout to go back to the original color. Is there any way that I can have a cell stay black after it has been clicked? I want it to stay highlighted black once it has been selected, and when you mouse over the other cells, they still change color. The highlighted cell should then unhighlight only when another link is clicked. I’m not really sure how to go about this so any help would be appreciated…

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@hokiedrumauthorMar 10.2003 — Should I create my own onmouseout function using a scripting language to do this? If I didn't create a script, how would I save the pointer for the link that was just clicked?
Copy linkTweet thisAlerts:
@2muchtimeMar 10.2003 — coucldn't you get those results without javascript and just use a:hober and a:visited styles. It wouldn't do you much good if you need to remove the highlighting after another link is clicked, but something to think about
Copy linkTweet thisAlerts:
@hokiedrumauthorMar 10.2003 — Thanks for the code...this stuff is pretty new to me but I'm beginning to get the idea. The code works, except that when I click another link, the other one will only go away when you mouseout on it again. Is there anything else I can add to my <td> tags to get that to work, or should I create some way to turn all links the original color once another link is clicked?
×

Success!

Help @hokiedrum 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 6.16,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...