<!DOCTYPE HTML><HTML> <Head> <MetaCharSet= "Utf-8"> <title></title> <Scriptsrc= "Js/jquery.js"></Script> <Script>window.onload= function() {document.getElementById ('Btnok'). onclick= function(){ //1. Match the first cell //$ (' Td:first '). html (' Test '); //2. Match the last cell //$ (' td:last '). html (' Test '); //3. Interlaced discoloration via odd and even //$ (' td:odd '). CSS (' backgroundcolor ', ' red '); //4. Match the cell with index 5 //$ (' Td:eq (5) '). CSS (' backgroundcolor ', ' red '); //5 Match all cells with index greater than 5 //$ (' td:gt (5) '). CSS (' backgroundcolor ', ' red '); //6. Match all cells with index less than 5 //$ (' Td:lt (5) '). CSS (' backgroundcolor ', ' red '); //7. Match all TD elements except index 5 $('Td:not (Td:eq (5))'). CSS ('BackgroundColor','Red'); } } </Script> </Head> <Body> <inputtype= "button"ID= "Btnok"value= "Match" /> <BR/> <Tablewidth= "$"Border= "1"> <TR> <TD>0</TD> <TD>1</TD> <TD>2</TD> <TD>3</TD> <TD>4</TD> <TD>5</TD> <TD>6</TD> <TD>7</TD> <TD>8</TD> <TD>9</TD> </TR> </Table> </Body></HTML>
Kill Thunder Dog jquery---3 general selector