All pastes #158895 Raw Edit

Untitled

public text v1 · immutable
·published 2006-09-02 13:02 UTC
rendered paste body
	this.addDesign=function(){
		var table=document.getElementById('myTable');
		//alert(table.innerHTML);
		var rows = table.getElementsByTagName("tr");   
		for(i = 0; i < rows.length; i++){           
			rows[i].onmouseover=function(){
				this.bgColor='#ff00ff';
			}
			rows[i].onmouseover=function(){
				this.bgColor='#ff00ff';
			}
			if(i % 2 == 0){ 
	 				this.bgColor='#dddddd';
        		}
				else{ 
       				this.bgColor = '#aaaaaa'; 
     			}
			rows[i].onmouseout=function(){
				alert(i);
				
			}
			if(i % 2 == 0){ 
	 			rows[i].bgColor='#dddddd';
        		rows[i].onmouseout=function(){
					this.bgColor='#dddddd';
				}
			}
			else{ 
       			rows[i].bgColor = '#aaaaaa'; 
     			rows[i].onmouseout=function(){
					this.bgColor='#aaaaaa';
				}
			}       
   		}
		var x=document.getElementById('myTable');
		var tdArr= x.getElementsByTagName('td');
		for(var i = 0; i < tdArr.length; i++) {
				tdArr[i].onclick = function (){
					//alert(this);
					//alert(this.innerHTML);
					//var firstcell=this.parentNode.firstChild.firstChild.nodeValue;
					//alert(firstcell);
					//this.bgColor='#00ff00';
					this.tableclick("this.innerHTML"));
					alert(this.innerHTML);
				};
				
		}
		
	}