<html>
<head>
<title>Page?Title</title>
<meta?http-equiv="Content-Type"?content="text/html;?charset=UTF-8"?/>
<script>
var?row=2,col=11,size=20,gap=5;
window.onload=function(){
var?wrap=document.createElement("div");
wrap.style.margin="0?auto";
wrap.style.width=(size+gap)*col+"px";
for(var?i=0;i<row;i++){
var?rows=document.createElement("div");
rows.style.float="left";
rows.style.marginBottom=gap+"px";
for(var?j=0;j<col;j++){
var?div=document.createElement("img");
div.src="a.png";
div.style.width=size+"px";
div.style.height=size+"px";
div.style.float="left";
div.style.marginLeft=gap+"px";
div.onclick=function(){
!this.abc?this.src="b.png":this.src="a.png";
this.abc=!this.abc;
}
rows.appendChild(div);
}
wrap.appendChild(rows);
}
document.body.appendChild(wrap);
}
</script>
</head>
<body>
</body>
</html>