- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsI need a way to change a cell's background color via a Javascript, called by the onmouseover event. I CANNOT simply change the cell color using the style tag within the TD, because multiple things happen onmouseover:
1) Cell color changes (not SPAN, not DIV, it's got to be the entire CELL)
2) Status message changes to a "tool tip" in bottom of browser (already figured out)
3) The HTML code inside a DIV, SPAN, or CELL (don't remember which) is changed elsewhere on the page (provides a screenshot and some examples of the item that the user is hovering over) (already figured out, I think)
I have a current version of this page that I'm trying to update. I re-coded the backbone of the page so it looks cleaner (and so the code makes more sense to me!) but the cell color changer only works in IE (and is a bit laggy).
Here is all I have for the new javascript so far (I haven't added the HTML code changer yet, but I think I've basically got that working from the 1st version):
<script language = "JavaScript">
<!--
function toolover(name)
{
self.status=name
return true
}
function tooloff()
{
self.status=' '
}
function changebg() <<<DOESN'T WORK>>>
{
'option1'.style.background
}
-->
</script>
A running example of the code that calls this script:
<td width="100%" align="center" style="cursor:pointer;" OnMouseOver="toolover('Alp
So basically here are my questions.
1) For the 'tooltip' in status bar - is there a way to return the message back to whatever it was before? Like, in IE is says "Done" but currently my code just sticks a non-breaking space to clear the tool tip, so whatever was there before is gone for good!
2) Is my code nice and pretty, and as compatible as possible, so far? All of my javascript experience has been cut and paste, this is my first time coding from scratch!
3) How can I get the cell bg in the example above to change? Some thoughts have been to use styles from inside the onmouseover (but can you call more than one thing from onmouseover? i hadn't gotten that to work). Also, css? I have never used css aside from customizing links.
Thanks for any suggestions and help!!
This question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership