Sunday, 23 November 2008

Learning Simple JQuery - Part 3.

This example demonstrates using JQuery selectors to add css classes to specific html table row elements. Add following JQuery to page using console in FireBug
  • $("#myColourTable tr:odd").addClass("tablerow"); $("#myColourTable tr:even").addClass("tablealtrow");
  • $("#myColourTable tr:first").removeClass("tablealtrow").addClass("heading");
Row NumberBig NumberWordDate
14345Animal23 January 1987
232546Vegetable18 November 2005
3265Mineral9 September 1973
44456Element31 December 1976
556Zebra14 August 2008
This simple JQuery example was taken from Stephen Walthers PDC 2008 talk.

No comments: