<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<style>
.tdborder{
border: 1px solid red;
}
</style>
<script type="text/javascript">
function test(){
var tb = document.getElementsByTagName("table")[0];
var trs = tb.getElementsByTagName("tr");
for(var i=0;i<trs.length;i++){
var td = trs[i].firstChild;
var tdl = trs[i].lastChild;
td.setAttribute("style","color:red");
tdl.setAttribute("style","color:red");
}
var tds = tb.getElementsByTagName("td");
for(var j=0;j<tds.length;j++){
tds[j].onmouseover = function(){
for(var k=0;k<tds.length;k++){
tds[k].className="";
}
this.className="tdborder";
}
tds[j].onclick = function(e){
var div = document.getElementsByTagName("div");
for(var a=0;a<div.length;a++){
document.body.removeChild(div[a]);
}
// var w = this.cellIndex;
// alert(w);
var e = e || window.event;
var day = this.innerHTML;
var d = document.createElement("div");
d.style.border = "1px solid red";
d.style.position = "absolute";
d.style.zIndex = 22;
d.style.left = e.clientX+20 + "px";