Home > Web Front-end > JS Tutorial > body text

jquery implementation of controlling table row highlighting example_jquery

WBOY
Release: 2016-05-16 17:32:43
Original
935 people have browsed it

[css]

Copy code The code is as follows:



[html]
Copy code The code is as follows:



  
  
       
  
   
       
  
   
       
  
   
       
  
   
       
  
姓名性别居住地
张三北京
李四上海
王五深圳
赵六北京
孙七上海



  
  
       
  
   
       
  
   
       
  
   
       
  
   
       
  
姓名性别居住地
张三北京
李四上海
王五深圳
赵六北京
孙七上海



jquery

[javascript]

复制代码 代码如下:

plaincopyprint?$(document).ready(function(){
//The first way of writing: $("tr:gt(0)") The first line of title does not work
$("tr:gt(0)").click(function(){
                               $(this).addClass("height").siblings().removeClass("height").end().find( ":radio").attr("checked",true);
                                                                                                                     $("tr:not(:first)").click(function(){
                         $(this).addClass("height").siblings().removeClass("height").end().find (":radio").attr("checked",true);
      })*/
})

$(document).ready(function(){
//The first way of writing: $("tr:gt(0)") The first line title does not work $("tr: gt(0)").click(function(){

$(this).addClass("height").siblings().removeClass("height").end().find(":radio") .attr("checked",true);
})

//Second way of writing: $("tr:not(:first)")
/*$("tr: not(:first)").click(function(){
$(this).addClass("height").siblings().removeClass("height").end().find(":radio" ).attr("checked",true);
})*/
})


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template