Old 12-22-2003   #1 (permalink)
Registered User
 
Frank Jaeger's Avatar
 
Join Date: Oct 2003
Location: Illinois
Posts: 107

Send a message via AIM to Frank Jaeger Send a message via MSN to Frank Jaeger
JavaScript

I was wondering if any of you could help me on this little diversion I've had lately. What I want to do is obtain the ability to change the background of a cell with an onclick. I've tried this...

Code:
<html>

<head>
<title>Test 3</title>
</head>

<body>

<table width="450" height="125">

<tr>
<td bgcolor="#555555" name="test_cell"></td>
</tr>

</table>

<a href="#" onclick="document.test_cell.bgcolor='#587DA7';">ONE</a>

</body>
</html>
Along with several other variants. However it claims that "document.test_cell" is null or undefined. Any ideas?
__________________
I am not original.
Frank Jaeger is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 12-23-2003   #2 (permalink)
Local Biorust Beast
 
Order's Avatar
 
Join Date: Oct 2003
Location: San Diego, CA, USA
Posts: 2,253

Send a message via AIM to Order Send a message via MSN to Order Send a message via Yahoo to Order
Javascript is a pain, I do not use it enough to really know it..

I would try document.tables.test_cell.bgcolor

It has something to do with DOM, or Document Object Model.. or how everything in an HTML page is classified..

If mine does not help, look for a mouseover that does the same thing, and just put it in your OnClick attribute.
__________________
Order is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT +1. The time now is 05:12 AM.
Content Relevant URLs by vBSEO 3.2.0

Design & Content © BioRUST 2008 :: PRIVACY STATEMENT :: LEGAL INFORMATION :: ADVERTISING MEDIA KIT