jQuery :even Selector

By: Bipin C Mathew 1 year, 7 months ago

Even is the simple mathematical term, An Even number is an integer which is multiple of two. The :even selector selects an odd index like 1, 3, 5, 7.. etc for each table row. The Even Selector selects the first element, third element, and so on . The even selector is an extension of jQuery and not part of the CSS specification.

Syntax  $(":even")


<!doctype html>
	<html lang="en">
	  <meta charset="utf-8">
	  <title>odd demo</title>
	  table {
	    background: #e3f7f5;
	  <script src="https://code.jquery.com/jquery-3.4.1.js"></script>
	<table border="1">
	  <tr><td>The Row 0</td></tr>
	  <tr><td>The Row 1</td></tr>
	  <tr><td>The Row 2</td></tr>
	  <tr><td>The Row 3</td></tr>
	$( "tr:even" ).css( "background-color", "#febbff" );


Let us talk!

We take the vision which comes from dreams and apply the magic of science and mathematics, adding the heritage of our profession and our knowledge to create a design.