472,978 Members | 2,142 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

getElementById multiple Id's

banning
42
ok ok i've read everywhere how using multiple id's is wrong and what not so don't get all hatefully, if there is a better way let me know... here is what i got

Expand|Select|Wrap|Line Numbers
  1. var click=0;
  2.  
  3. function bgCOLOR(){
  4.     if(click==0){
  5.         click=1;
  6.     }else{
  7.         click=0;
  8.     }
  9.  
  10.     if (click==1){
  11.         document.getElementById('heha').style.backgroundColor='red';
  12.     }else{
  13.         document.getElementById('heha').style.backgroundColor='white';
  14.     }
  15. }
  16.  
  17. <table>
  18. <tr>
  19. <td id="heha'" onclick="bgCOLOR();"></td>
  20. </tr>
  21. <tr>
  22. <td id="heha'" onclick="bgCOLOR();"></td>
  23. </tr>
  24.  
ok so my noob question is why wont it change the background color on both table divisions?

im pretty entry level at javascript i primarly use just php but i figured its time to grow and start integrating the 2.

anyway thanks for the help guys in advance.
Aug 31 '07 #1
26 4184
pbmods
5,821 Expert 4TB
Heya, Banning.

Try using the name property, which does not have to be unique:
Expand|Select|Wrap|Line Numbers
  1. <td name="myName" ... >
  2. .
  3. .
  4. .
  5. <td name="myName" ... >
  6.  
Expand|Select|Wrap|Line Numbers
  1. var tds = document.getElementsByName('myName');
  2. for( var i = 0; i < tds.length; ++i )
  3. {
  4.     tds[i].style.backgroundColor = 'annoyingly bright neon peach';
  5. }
  6.  
Aug 31 '07 #2
banning
42
wow you're just like every where on these boards haha... i really love getting help from ya you explain things very well
Aug 31 '07 #3
pbmods
5,821 Expert 4TB
Heya, Banning.

We aim to please.

Good luck with your project, and if you ever need anything, post back anytime :)
Aug 31 '07 #4
markrawlingson
346 Expert 100+
If i might suggest a slightly different method...

Expand|Select|Wrap|Line Numbers
  1. function bgCOLOR(oObj,sColorOn,sColorOff) {
  2.      if (oObj.style.backgroundColor == sColorOn) {
  3.           oObj.style.backgroundColor = sColorOff;
  4.      }
  5.      else {
  6.           oObj.style.backgroundColor = sColorOn;
  7.      }
  8. }
  9.  
Expand|Select|Wrap|Line Numbers
  1. <tr>
  2. <td onClick="bgCOLOR(this,'#000000','#FF0000');">
  3.  
  4. </td>
  5. </tr>
  6.  
This way you don't need to fiddle with any ids or names for these objects because you are refering to 'this' - ie: the object that fired the event (onClick) - you can also re-use this function over and over and apply any color to it on the fly.
Aug 31 '07 #5
Expand|Select|Wrap|Line Numbers
  1. window.onload = function() {
  2. tds = document.getElementsByTagName("td")
  3.     for (x=0; x<tds.length; x++) {
  4.     tds[x].onclick = colorIt
  5.     }
  6. }
  7.  
  8. function colorIt() {
  9.     if (!this.color) { this.color = "off" }
  10.  
  11.     if (this.color == "off") {
  12.     this.color = "on"
  13.     this.style.background = "#000"
  14.     }
  15.  
  16.     else {
  17.     this.color = "off"
  18.     this.style.background = "#fff"
  19.     }
  20. }
  21.  
Or you can do something like that so you dont wanna to place function calls directly into the html!
Aug 31 '07 #6
banning
42
all of that up there... that i wrote... lol ignore it... i was lookin at your code... and like i said before i'm learning javascript, fortunatly its pretty close to AS but anyway... i say there is an onclick function thats pretty nifty... i may have to empliment that so i dont have functions right in the html :)
Aug 31 '07 #7
banning
42
Heya, Banning.

Try using the name property, which does not have to be unique:
Expand|Select|Wrap|Line Numbers
  1. <td name="myName" ... >
  2. .
  3. .
  4. .
  5. <td name="myName" ... >
  6.  
Expand|Select|Wrap|Line Numbers
  1. var tds = document.getElementsByName('myName');
  2. for( var i = 0; i < tds.length; ++i )
  3. {
  4.     tds[i].style.backgroundColor = 'annoyingly bright neon peach';
  5. }
  6.  
i tried that code and it works great in firefox but it wont work in IE... i tried using
Expand|Select|Wrap|Line Numbers
  1. document.write(tds)
after
Expand|Select|Wrap|Line Numbers
  1.  var tds = document.getElementsByName('myName'); 
but before the
Expand|Select|Wrap|Line Numbers
  1. for( var i = 0; i < tds.length; ++i )
and what i got in IE was [object] and in FireFox i get [object HTMLCollection]

im trying to teach myself javascript and im sure there is something there that the document.write is telling me LOL i just dont know what to do with that information

if you want to see the site im using it on you can find it here...
http://www.doughxpress.com/staging/d...ilsElec?Wid=76
Sep 7 '07 #8
pbmods
5,821 Expert 4TB
Heya, Banning.

First off, you might like this:
[CODE=javascript]
JavaScript goes here.
[/code]

~_^

Now then.

Does IE throw an error at you? Or does your script just seem not to do anything?
Sep 7 '07 #9
banning
42
Heya, Banning.

First off, you might like this:
Expand|Select|Wrap|Line Numbers
  1. JavaScript goes here.
  2.  
~_^

Now then.

Does IE throw an error at you? Or does your script just seem not to do anything?
Thanks about the code thing can I do CODE=php and stuff too?

and I don't get any errors coming up in IE it just doesn't do anything
Sep 10 '07 #10
iam_clint
1,208 Expert 1GB
do this
Expand|Select|Wrap|Line Numbers
  1. document.write(tds.length);
sometimes IE has a problem pulling names where the id's are the same.

the number it writes to the page should be > 0
Sep 10 '07 #11
drhowarddrfine
7,435 Expert 4TB
Try using the name property, which does not have to be unique:
This is what 'class' is for. Just change all the ids to 'class='.
Sep 10 '07 #12
banning
42
do this
Expand|Select|Wrap|Line Numbers
  1. document.write(tds.length);
sometimes IE has a problem pulling names where the id's are the same.

the number it writes to the page should be > 0

I tried it and it wrote back 0

it didnt write > 0
Sep 11 '07 #13
banning
42
This is what 'class' is for. Just change all the ids to 'class='.

change all the name= to class= ?

if i do that then i cant use getElementsByName right? and as far as i know there is no getElementByClass
Sep 11 '07 #14
drhowarddrfine
7,435 Expert 4TB
No. Change the id's to class. id can only be used once per page. Class can be used for multiple elements.
Sep 11 '07 #15
banning
42
No. Change the id's to class. id can only be used once per page. Class can be used for multiple elements.

im not using Id thought im using name
Sep 11 '07 #16
drhowarddrfine
7,435 Expert 4TB
In your initial post you show using 'id' so I assumed you still were.
Sep 11 '07 #17
banning
42
In your initial post you show using 'id' so I assumed you still were.

nah i went ahead with pbmods solution

Expand|Select|Wrap|Line Numbers
  1.  
  2. <td name="myName" ... >
  3.  
  4.  
  5. <td name="myName" ... >
  6.  
Expand|Select|Wrap|Line Numbers
  1.       var tds = document.getElementsByName('myName');
  2.       for( var i = 0; i < tds.length; ++i )
  3.       {
  4.           tds[i].style.backgroundColor = 'annoyingly bright neon peach';
  5.       }
  6.  
Sep 11 '07 #18
banning
42
do this
Expand|Select|Wrap|Line Numbers
  1. document.write(tds.length);
sometimes IE has a problem pulling names where the id's are the same.

the number it writes to the page should be > 0

see when i do this in IE it comes out as 0
but when i do it in FIREFOX it comes out as 41
Sep 11 '07 #19
acoder
16,027 Expert Mod 8TB
see when i do this in IE it comes out as 0
but when i do it in FIREFOX it comes out as 41
I think that IE has problems with tds and getElementsByName. A bit of testing shows that it just doesn't work. Give your table an id and try:
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('tableID').getElementsByTagName("td");
Sep 13 '07 #20
banning
42
I think that IE has problems with tds and getElementsByName. A bit of testing shows that it just doesn't work. Give your table an id and try:
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('tableID').getElementsByTagName("td");
when i try that it turns the whole table the color... what im trying to accomplish is just turn an individual column one color. course you probably all ready know that but yea i tried it and it worked in firefox and ie like it should :)
Sep 14 '07 #21
acoder
16,027 Expert Mod 8TB
when i try that it turns the whole table the color... what im trying to accomplish is just turn an individual column one color. course you probably all ready know that but yea i tried it and it worked in firefox and ie like it should :)
So have you got it working or not?
Sep 16 '07 #22
banning
42
So have you got it working or not?

no its not working... ie just sucks i guess... when i do what you posted it just turns the whole table a colour... i dont want that, i want to highlight just one column...

here is the site im using it on, http://doughxpress.com/staging/dryerDetailsElec?Wid=76
Sep 17 '07 #23
iam_clint
1,208 Expert 1GB
Heres a sample i made for you highlighting rows and cols without using names and works in firefox and ie. To use the code you will need to change your table accordingly.
Expand|Select|Wrap|Line Numbers
  1. <script>
  2. vertColor="#66ffcc"
  3. horzColor="#b7efff";
  4.  
  5. function vertClick(col, tbl) {
  6.     var color="";
  7.     var table = document.getElementById(tbl);
  8.     var entireRow=table.getElementsByTagName("tr");
  9.     var curColor = entireRow[0].getElementsByTagName("td")[col].style.backgroundColor;
  10.     for (i=0; i<entireRow.length; i++) {
  11.         curEle = entireRow[i].getElementsByTagName("td")[col];
  12.         if (curEle.getAttribute("vert")==null || curEle.getAttribute("vert")=="false") { curEle.setAttribute("vert", "true"); color = vertColor; } else { curEle.setAttribute("vert", "false"); color=""; }
  13.         if (color=="" && curEle.getAttribute("horz")=="true") { curEle.style.backgroundColor=horzColor; } else { curEle.style.backgroundColor=color; }
  14.     }
  15. }
  16.  
  17. function horzClick(row, tbl) {
  18.     var color="";
  19.     var table = document.getElementById(tbl);
  20.     var entireRow=table.getElementsByTagName("tr")[row-1];
  21.     var tds = entireRow.getElementsByTagName("td");
  22.     var curColor = tds[1].style.backgroundColor;
  23.     for (i=1; i<tds.length; i++) {
  24.         curEle = tds[i];
  25.         if (curEle.getAttribute("horz")==null || curEle.getAttribute("horz")=="false") { curEle.setAttribute("horz", "true"); color = horzColor; } else { curEle.setAttribute("horz", "false"); color=""; }
  26.         if (curEle.getAttribute("vert")=="true") { curEle.style.backgroundColor=vertColor; } else {  curEle.style.backgroundColor = color; }
  27.     }
  28. }
  29. </script>
  30. <STYLE>
  31. tr { cursor: pointer; }
  32. table { border-collapse: collapse; width: 100%; height: 100%;}
  33. </STYLE>
  34. <table border=1>
  35. <tbody id="example">
  36. <tr><td  onclick="horzClick('1', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  37. <tr><td  onclick="horzClick('2', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  38. <tr><td  onclick="horzClick('3', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  39. <tr><td  onclick="horzClick('4', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  40. <tr><td  onclick="horzClick('5', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  41. <tr><td  onclick="horzClick('6', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  42. <tr><td  onclick="horzClick('7', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  43. <tr><td  onclick="horzClick('8', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  44. <tr><td  onclick="horzClick('9', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  45. <tr><td  onclick="horzClick('10', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  46. <tr><td  onclick="horzClick('11', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  47. <tr><td  onclick="horzClick('12', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  48. <tr><td  onclick="horzClick('13', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  49. <tr><td  onclick="horzClick('14', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  50. <tr><td  onclick="horzClick('15', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  51. <tr><td  onclick="horzClick('16', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  52.  
  53. </tbody>
  54. </table>
  55.  
This code should do exactly what you want in all browsers!
Sep 17 '07 #24
iam_clint
1,208 Expert 1GB
Code fixed for colspan checks

Expand|Select|Wrap|Line Numbers
  1. <script>
  2. vertColor="#66ffcc"
  3. horzColor="#b7efff";
  4.  
  5. function vertClick(col, tbl) {
  6.     var color="";
  7.     var blnColSpan = false;
  8.     var table = document.getElementById(tbl);
  9.     var entireRow=table.getElementsByTagName("tr");
  10.     for (i=0; i<entireRow.length; i++) {
  11.         curEle = entireRow[i].getElementsByTagName("td")[col];
  12.         for (b=0; b<entireRow[i].getElementsByTagName("td").length; b++) { 
  13.             colspan = entireRow[i].getElementsByTagName("td")[b].getAttribute("colspan");
  14.             if (colspan!=null && colspan!=1) { blnColSpan = true; }
  15.         }
  16.         if (!blnColSpan) { 
  17.             if (typeof(curEle)=="object") {
  18.                 if (curEle.getAttribute("vert")==null || curEle.getAttribute("vert")=="false") { curEle.setAttribute("vert", "true"); color = vertColor; } else { curEle.setAttribute("vert", "false"); color=""; }
  19.                 if (color=="" && curEle.getAttribute("horz")=="true") { curEle.style.backgroundColor=horzColor; } else { curEle.style.backgroundColor=color; }
  20.             }
  21.         }
  22.         blnColSpan = false;
  23.     }
  24. }
  25.  
  26. function horzClick(row, tbl) {
  27.     var color="";
  28.     var table = document.getElementById(tbl);
  29.     var entireRow=table.getElementsByTagName("tr")[row-1];
  30.     var tds = entireRow.getElementsByTagName("td");
  31.     for (i=1; i<tds.length; i++) {
  32.         curEle = tds[i];
  33.         if (curEle.getAttribute("horz")==null || curEle.getAttribute("horz")=="false") { curEle.setAttribute("horz", "true"); color = horzColor; } else { curEle.setAttribute("horz", "false"); color=""; }
  34.         if (curEle.getAttribute("vert")=="true") { curEle.style.backgroundColor=vertColor; } else {  curEle.style.backgroundColor = color; }
  35.     }
  36. }
  37. </script>
  38.  
Sep 17 '07 #25
iam_clint
1,208 Expert 1GB
This is the same thing except theres an intersecting color.
Expand|Select|Wrap|Line Numbers
  1. <script>
  2. /* Javascript written by iam_clint */
  3. vertColor="#66ffcc";
  4. horzColor="#b7efff";
  5. intersectColor="#aa22f0";
  6.  
  7. function vertClick(col, tbl) {
  8.     var color="";
  9.     var blnColSpan = false;
  10.     var table = document.getElementById(tbl);
  11.     var entireRow=table.getElementsByTagName("tr");
  12.     for (i=0; i<entireRow.length; i++) {
  13.         curEle = entireRow[i].getElementsByTagName("td")[col];
  14.         for (b=0; b<entireRow[i].getElementsByTagName("td").length; b++) { 
  15.             colspan = entireRow[i].getElementsByTagName("td")[b].getAttribute("colspan");
  16.             if (colspan!=null && colspan!=1) { blnColSpan = true; }
  17.         }
  18.         if (!blnColSpan) { 
  19.             if (typeof(curEle)=="object") {
  20.                 if (curEle.getAttribute("vert")==null || curEle.getAttribute("vert")=="false") { curEle.setAttribute("vert", "true"); color = vertColor; } else { curEle.setAttribute("vert", "false"); color=""; }
  21.                 if (curEle.getAttribute("horz")=="true" && curEle.getAttribute("vert")=="true") { curEle.style.backgroundColor=intersectColor; } else if (curEle.getAttribute("vert")=="false" && curEle.getAttribute("horz")=="true") { curEle.style.backgroundColor=horzColor; } else { curEle.style.backgroundColor=color; }
  22.             }
  23.         }
  24.         blnColSpan = false;
  25.     }
  26. }
  27.  
  28. function horzClick(row, tbl) {
  29.     var color="";
  30.     var table = document.getElementById(tbl);
  31.     var entireRow=table.getElementsByTagName("tr")[row-1];
  32.     var tds = entireRow.getElementsByTagName("td");
  33.     for (i=1; i<tds.length; i++) {
  34.         curEle = tds[i];
  35.         if (curEle.getAttribute("horz")==null || curEle.getAttribute("horz")=="false") { curEle.setAttribute("horz", "true"); color = horzColor; } else { curEle.setAttribute("horz", "false"); color=""; }
  36.         if (curEle.getAttribute("vert")=="true" && curEle.getAttribute("horz")=="true") { curEle.style.backgroundColor=intersectColor; } else if (curEle.getAttribute("vert")=="true" && curEle.getAttribute("horz")=="false") {  curEle.style.backgroundColor = vertColor; } else { curEle.style.backgroundColor = color;  }
  37.     }
  38. }
  39. </script>
  40. <STYLE>
  41. tr { cursor: pointer; }
  42. table { border-collapse: collapse; width: 100%; height: 100%;}
  43. </STYLE>
  44. <table border=1>
  45. <tbody id="example">
  46. <tr><td  onclick="horzClick('1', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  47. <tr><td  onclick="horzClick('2', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  48. <tr><td  onclick="horzClick('3', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  49. <tr><td  onclick="horzClick('4', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  50. <tr><td  onclick="horzClick('5', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  51. <tr><td  onclick="horzClick('6', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  52. <tr><td  onclick="horzClick('7', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  53. <tr><td  onclick="horzClick('8', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  54. <tr><td  onclick="horzClick('9', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  55. <tr><td  onclick="horzClick('10', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  56. <tr><td  onclick="horzClick('11', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  57. <tr><td  onclick="horzClick('12', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  58. <tr><td  onclick="horzClick('13', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  59. <tr><td  onclick="horzClick('14', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  60. <tr><td  onclick="horzClick('15', 'example');">Test1<td onclick="vertClick('1', 'example');">Test2<td onclick="vertClick('2', 'example');">Test3<td onclick="vertClick('3', 'example');">Test4<td onclick="vertClick('4', 'example');">Test5<td onclick="vertClick('5', 'example');">Test6
  61.  
  62. </tbody>
  63. </table>
  64.  
  65.  
Sep 18 '07 #26
banning
42
This is the same thing except theres an intersecting color.

This is the answer too
Sep 18 '07 #27

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

Similar topics

1
by: lawrence | last post by:
This PHP function prints out a bunch of Javascript (as you can see). This is all part of the open source weblog software of PDS (www.publicdomainsoftware.org). We had this javascript stuff...
6
by: MNF | last post by:
Hi everyone, I am using document.getElementById function in JavaScript to find a control within an html body, but instead I get back META item, because incidently the name of one meta tags is the...
24
by: Robi | last post by:
I have the following problem: I populate a page with a specific amount of <div id="MyTest"> containers inside another <div> container. for (i=0; i < MyString.length; i++) document.write('<div...
3
by: davidkarlsson74 | last post by:
Error: document.getElementById("folderMenu").cells has no properties File: http://www.volkswagen.se/tillbehor/js/foldermenu.js Rad: 49 The function activates different DIV:s, but doesn't seem to...
12
by: bcr07548 | last post by:
I am writing a web site that uses JavaScript to validate certain forms and I seem to be having some trouble. The site uses PHP and for one of the forms, depending on the situation, one of of the...
3
by: palak123i | last post by:
Hi All, I am using a javascript to submit a request using AJAX. Part of javascript code as follows: var favElement = document.getElementById('fav1'); alert(favElement); for (var i = 0; i <...
4
by: dr1ft3r | last post by:
Hey guys, I'm building a site for a landscaping business down the street and can't seem to get part of the code functioning correctly. The code fails on line 68 where I make a reference to an...
29
by: Nick | last post by:
I've seen a few frameworks use the following: function $(id) { return document.getElementById(id); } Then to use: $('something').innerHTML = 'blah'; I'm just trying to roll this out to my...
2
by: vegetable21 | last post by:
Hi, I'm relatively new to JavaScript, but not to programming. I'm trying to get a table to expand and collapse within a cell of my master table. However i want to collapse all the other open...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.