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
[CODE=javascript]
var click=0;
function bgCOLOR(){
if(click==0){
click=1;
}else{
click=0;
}
if (click==1){
document.getEle mentById('heha' ).style.backgro undColor='red';
}else{
document.getEle mentById('heha' ).style.backgro undColor='white ';
}
}
<table>
<tr>
<td id="heha'" onclick="bgCOLO R();"></td>
</tr>
<tr>
<td id="heha'" onclick="bgCOLO R();"></td>
</tr>
[/CODE]
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.
[CODE=javascript]
var click=0;
function bgCOLOR(){
if(click==0){
click=1;
}else{
click=0;
}
if (click==1){
document.getEle mentById('heha' ).style.backgro undColor='red';
}else{
document.getEle mentById('heha' ).style.backgro undColor='white ';
}
}
<table>
<tr>
<td id="heha'" onclick="bgCOLO R();"></td>
</tr>
<tr>
<td id="heha'" onclick="bgCOLO R();"></td>
</tr>
[/CODE]
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.
Comment