<html>
<head>
<script src="jquery.js"></script>
<script>
$(function(){
$("tr:even").addClass("x");
$("tr:odd").addClass("y");
$("tr").hover(function(){
$(this).addClass("z");
},function(){
$(this).removeClass("z");
});
});
</script>
<style>
.x{
background:yellow;
}
.y{
background:pink;
}
.z{
background:cyan;
}
</style>
</head>
<body>
<table border=1>
<tr><td>1</td><td>stud1</td></tr>
<tr><td>2</td><td>stud2</td></tr>
<tr><td>3</td><td>stud3</td></tr>
<tr><td>4</td><td>stud4</td></tr>
<tr><td>5</td><td>stud5</td></tr>
<tr><td>6</td><td>stud6</td></tr>
<tr><td>7</td><td>stud7</td></tr>
<tr><td>8</td><td>stud8</td></tr>
<tr><td>9</td><td>stud9</td></tr>
</table>
</body>
</html>
<head>
<script src="jquery.js"></script>
<script>
$(function(){
$("tr:even").addClass("x");
$("tr:odd").addClass("y");
$("tr").hover(function(){
$(this).addClass("z");
},function(){
$(this).removeClass("z");
});
});
</script>
<style>
.x{
background:yellow;
}
.y{
background:pink;
}
.z{
background:cyan;
}
</style>
</head>
<body>
<table border=1>
<tr><td>1</td><td>stud1</td></tr>
<tr><td>2</td><td>stud2</td></tr>
<tr><td>3</td><td>stud3</td></tr>
<tr><td>4</td><td>stud4</td></tr>
<tr><td>5</td><td>stud5</td></tr>
<tr><td>6</td><td>stud6</td></tr>
<tr><td>7</td><td>stud7</td></tr>
<tr><td>8</td><td>stud8</td></tr>
<tr><td>9</td><td>stud9</td></tr>
</table>
</body>
</html>
0 comments:
Post a Comment