Please HELP with JQUERY and JavaScript
1.In the jquery.altrow.js file, code a plugin that uses the getElementsByTagName method to get all of an element's "tr" child elements. Then, it should apply a class named "header" to the header row, and classes named "even" and "odd" on an alternating basis to the rest of the rows. Note: you can check whether a row contains "th" elements to see if it's a header row.
2. In the altrow.js file, add code to the onload event that calls the plugin for the table element. Run the application and see that the row styles are applied to the table.
HTML file:
Alternating Row Plugin
Important People in Computer Science
First Name | Last Name | Date of Birth | Accomplishment |
---|
Charles | Babbage | 12/26/1791 |
Originated the concept of a programmable computer, invented the first mechanical computer. |
Ada | Lovelace | 12/10/1815 |
First computer programmer. Wrote an algorithm for Babbage's mechanical computer. |
Alan | Turing | 6/23/1912 |
Invented the Turing Machine, a hypothetical device that's a model of a general purpose computer. |
Grace | Hopper | 12/9/1906 |
Invented the first compiler for a computer programming language, popularized the term "debugging" for fixing computer glitches. |
query.altrow.js file:
"use strict";
altrow.js file
"use strict";
window.onload = function() {
};