The example in this article describes the method that the JS+CSS implementation can sag to display the selected cells. Share to everyone for your reference. The implementation methods are as follows:
Copy Code code as follows:
<TITLE>JS+CSS implementation can SAG display the selected cells </title>
<style>
TD{CURSOR:HAND;FONT-SIZE:12PX}
. click{border-top:1px solid #0033CC; border-bottom:1px solid #DDEEFF; border-left:1px solid #0033CC; border-right:1px Solid #DDEEFF;p adding-top:5px;padding-bottom:3px;padding-left:5px;padding-right:3px;}
. hover{border-top:1px solid #DDEEFF; border-bottom:1px solid #0033CC; border-left:1px solid #DDEEFF; border-right:1px Solid #0033CC;p adding:4px;}
. normal{border:1px solid #FFFFFF;p adding:4px;}
</style>
<body>
<script>
function Overbutton () {
if (src=event.srcelement)
if (src.classname== "normal") {
Src.classname= ' hover ';
}
}
function Outbutton () {
if (src=event.srcelement)
if (src.classname== "hover") {
Src.classname= ' normal ';
}
}
function Clickbutton () {
if (src=event.srcelement)
if (src.classname== "hover") {
var cells=document.all.button.rows[0].cells;
for (i=0;i<cells.length; i++)
{cells[i].classname= "normal";
}
Src.classname= ' click ';
}
}
Document.onmouseover=overbutton
Document.onmouseout=outbutton
Document.onclick=clickbutton</script>
<table id=button>
<TR>
<TD class=click> Daily </TD>
<TD class=normal> Weekly </TD>
<TD class=normal> Monthly Report </TD>
<TD Class=normal> Quarterly </TD>
<TD class=normal> Daily </TD>
<TD class=normal> Weekly </TD>
<TD class=normal> Monthly Report </TD>
<TD Class=normal> Quarterly </TD>
</TR>
</TABLE>
</body>
I hope this article will help you with your JavaScript programming.