📜  jQuery | :偶数选择器

📅  最后修改于: 2021-11-25 04:19:40             🧑  作者: Mango

jQuery :even 选择器用于从元素中选择偶数索引。索引的编号从 0 开始。工作方式与:odd选择器相同,但适用于偶数。

句法

$(":even")

示例 1:



  

    
      
  

  

  
    
        

GeeksForGeeks

                                                                                                                                                                                                                                                                                                                                                                                            
CompanyCountry
relianceIndia
flipkartIndia
walmartAmerican
Ernst HandelAustria
Island TradingUK
    
     

输出:

示例 2:



  

    
     
  

  

  
    
        

Welcome To GeeksForGeeks       

                                                                                                                                                                                                                                                                    
StateCapital
uttar pradeshlucknow
punjabchandigarh
haryanacandigarh
    
     

输出: