473,395 Members | 1,658 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Change cell color

60
Why can't i do this:

[HTML]<html>
<body>
<pre><center>
<table border=2><tr><td onmouseover="bgcolor="red"" onclick="bgcolor="blue"" onkeyup="bgcolor="brown"" onkeydown="bgcolor="black"">aaaaaa</td></tr></table>
</center></pre>
</body>
</html>[/HTML]

?????
Jun 13 '07 #1
5 2014
epots9
1,351 Expert 1GB
[HTML]
<html>
<body>
<pre><center>
<table border=2><tr><td name="cell1" id="cell1" onmouseover="this.style.backgroundColor='red'" onclick="this.style.backgroundColor='blue'" onkeyup="this.style.backgroundColor='brown'" onkeydown="this.style.backgroundColor='black'">aaa aaa</td></tr></table>
</center></pre>
</body>
</html>
[/HTML]

that should do the trick.
Jun 13 '07 #2
Hi there, I was looking around with the exact same question and this works to highlight the background of the cell on mouseover, but then does not change back and remains the same. I have put all of the code on the same line but can only assume it gets stuck at the first instruction?
Any help gratefully received!
Jun 13 '07 #3
shoonya
161 100+
Hi there, I was looking around with the exact same question and this works to highlight the background of the cell on mouseover, but then does not change back and remains the same. I have put all of the code on the same line but can only assume it gets stuck at the first instruction?
Any help gratefully received!
it's not sticking
add the onmouseover event handler too

shoonya
Jun 14 '07 #4
acoder
16,027 Expert Mod 8TB
Hi there, I was looking around with the exact same question and this works to highlight the background of the cell on mouseover, but then does not change back and remains the same. I have put all of the code on the same line but can only assume it gets stuck at the first instruction?
Any help gratefully received!
Change it back using onmouseout.
Jun 14 '07 #5
shoonya
161 100+
Change it back using onmouseout.
thnx acoder
i misspelled it but wanted to say same thing :D
Jun 14 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Reply Via Newsgroup | last post by:
Folks, Say I have a table, ten columns, ten rows - Each with a word in it. I want to change the values of some/all of the cells in the table via a hyperlink. How do I reference each cell and...
1
by: Michael | last post by:
How can I use onclick to change a table cell background color. I know I can use this.className=? to change the classname. But then I would have to put the code into every single table cell. I...
2
by: Pete Kipe | last post by:
I'm not a JavaScript programmer...but I'm trying to put together a simple menu system for a new website and need a little help. I have the following script: <SCRIPT language=javascript> <!--...
3
by: michael | last post by:
I'm changing colors of table cells like this: <style type="text/css"> ..over {background-color: #bedddc} ..out {background-color: #99cccc} </style> <td onmouseover="this.className='over'"...
3
by: Peter Williams | last post by:
Hi All, I want to write some javascript for a html page which does the following. Imagine that the page contains a table with 2 columns and 3 rows, e.g.: +---+---+ | A | B | +---+---+
3
by: Richard | last post by:
I'm trying to change a value of a cell based on another before the grid is displayed. I'm using the ItemDataBound event like this for a simple test: Select Case e.Item.ItemType Case...
4
by: HB | last post by:
So I have a table in ASP.NET <table runat="server" id="tblMyTable"> <tr> <td id="cellMyCell">word</td> </tr> </table> How do I reference the cell "cellMyCell" from the Vb.NET 1.1...
3
by: John Smith | last post by:
I'm looking into this peace of code: protected void DropDown_SelectedIndexChanged(object sender, EventArgs e) { DropDownList list = (DropDownList)sender; TableCell cell = list.Parent as...
2
by: John Smith | last post by:
Will this line of the code: item.Cells.Text = "Some text..."; change only DataGrid visual value or it will also change value in the DataSource? How can I change value in DataSource? ...
0
by: =?Utf-8?B?QnJpYW5ESA==?= | last post by:
Hi I am trying to find a way to change the background color of a cell (flash or blink) when its value has changed (by user or data update). I need to be able to do this for more than one cell...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.