document.getElementById("square5").onmousedown = toggleColor;
function toggleColor(evt){
if(evt){
var thisSquare = evt.target;
}else{
var thisSquare = window.event.srcElement;alert(thisSquare);
}
if(thisSquare.className == ""){
thisSquare.className = "pickedBG";
}else{
thisSquare.className = "";
}
} |
|