Jquery filters of first last not even odd

  • 2020-03-30 01:26:27
  • OfStack

 
$(function(){ 
$("#menu li:first").click(function(){ 
$(this).addClass("b"); 
}); 
$("#menu li:last").text(" The last ");//Insert the last li element in the li list with id menu into the text "last"
$("#menu li:first").text(" The first ");//Insert the text "first" into the first li element in the li list
$("#menu li:not(.on)").text("on");//Insert the text "on" into the li element in the li list whose style is not class="on"
$("#menu li:even").text(" An odd number of rows "); 
$("#menu li:odd").text(" Even lines "); 
}); 


Related articles: