JS adds an onmouseover event to tr
Add jquery to the project (see csdn space 6/JS/jquery. JS)
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
Transitional. DTD ">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Title> untitled document </title>
<SCRIPT src = "/JS/jquery. js"> </SCRIPT>
<SCRIPT>
$ (Document). Ready (function (){
$ ('# Data tbody tr'). Hover (
Function (){
$ (This). addclass ('bgc1 ');
},
Function ()
{
$ (This). removeclass ('bgc1 ');
}
);
})
</SCRIPT>
<Style>
. Bgc1
{
Color: #000000;
Background-color: # e7fafe;
}
</Style>
</Head>
<Body>
<Table id = "data">
<Caption>
Book list
</Caption>
<Thead>
<Tr>
<TH> title </Th>
<TH> dsfdf </Th>
<TH> sdfsdf </Th>
<TH> sdfdfssdf </Th>
</Tr>
</Thead>
<Tbody>
<Tr>
<TD> dfsdsfsdf </TD>
<TD> dsfdf </TD>
<TD> dsfsdf </TD>
<TD> dsfsdfsdfa </TD>
</Tr>
<Tr>
<TD> sdfsdf </TD>
<TD> sdsdf </TD>
<TD> dfssdf </TD>
<TD> dsfdfs </TD>
</Tr>
<Tr>
<TD> sdfdfsdf </TD>
<TD> sdfdfs </TD>
<TD> sdfsdf </TD>
<TD> dfsdfs </TD>
</Tr>
</Tbody>
</Table>
</Body>
</Html>
</Body>
</Html>