复制代码 代码如下:$(document).ready(function(){ $("p:odd").css("background-color", "#bbf"); $("p:even").css("background-color","#ffc"); $("p").click(function () { $("p").each(function(){ if($(this).hasClass("highlight")){ $(this).removeClass("highlight"); }}); $(this).addClass("highlight"); }); }); 源码参考gamil:test_jquery_table
推荐阅读
JQuery 学习笔记 选择器之五
复制代码 代码如下:<!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 h>>>详细阅读
本文标题:运用jquery实现table单双行不同显示并能单行选中
地址:http://www.17bianji.com/kaifa2/JS/28383.html
1/2 1