All pastes #386504 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-03-08 17:49 UTC
rendered paste body
window.onload = initAll;

function initAll(){
	var tds = document.getElementById("myTR").getElementsByTagName("td");
	for(var i=0; i< tds.length; i++){
		tds.onmouseover = doThis;
		tds.onmouseout = undoThis;
	}
}
function doThis(){
	var element = document.getElementById(this.id);
	switch(this.id){
		case "td1":
			element.blahblah = something; // do stuff related to the element here
		break;
		default:
		//default
		break;
	}
	//code related globally
}
function undoThis(){
	//here change the background to default
	
}