jQuery实现选中行变色效果(实例讲解)
(编辑:jimmy 日期: 2025/12/5 浏览:3 次 )
//点击复选框添加样式
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
table {
border: 0;
border-collapse: collapse;
}
td {
font: normal 12px/17px Arial;
padding: 2px;
width: 100px;
}
th {
font: bold 12px/17px Arial;
text-align: left;
padding: 4px;
border-bottom: 1px solid #333;
}
.even {
background: #FFF38F;
}
/* 偶数行样式*/
.odd {
background: #FFFFEE;
}
/* 奇数行样式*/
.selected {
background: #FF6500;
color: #fff;
}
</style>
<script src="/UploadFiles/2021-04-02/jquery-1.11.3.min.js">
//点击行添加样式
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
table {
border: 0;
border-collapse: collapse;
}
td {
font: normal 12px/17px Arial;
padding: 2px;
width: 100px;
}
th {
font: bold 12px/17px Arial;
text-align: left;
padding: 4px;
border-bottom: 1px solid #333;
}
.even {
background: #FFF38F;
}
/* 偶数行样式*/
.odd {
background: #FFFFEE;
}
/* 奇数行样式*/
.selected {
background: #FF6500;
color: #fff;
}
</style>
<script src="/UploadFiles/2021-04-02/jquery-1.11.3.min.js">
以上这篇jQuery实现选中行变色效果(实例讲解)就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。
下一篇:运用jQuery写的验证表单(实例讲解)