JS+CSS implementations can sag the method of displaying selected cells _javascript tips

Source: Internet
Author: User

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:
&LT;TITLE&GT;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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.