I have a problem with changing the background color in a table cell when i click on the content in the cell.
Here is my code:
Expand|Select|Wrap|Line Numbers
- <script type="text/javascript">
- var ie = document.all
- var ns = document.getElementById && !ie
- function rowclick(e) {
- var obj = ns ? e.target : event.srcElement
- if (obj.id=="click") {
- obj.style.background="#ff0066"
- obj.onblur=function() {
- obj.style.background="#F7F4EC"
- }
- }
- }
- document.onclick=rowclick
- </script>
Expand|Select|Wrap|Line Numbers
- <a href="#" id="click">Some text</a>
The real problem is that i have cells with two different original background colors.
How do i do this, so that the original background returns when clicking another content in another cell with different background.........?