This gist contains some exercises to practice jQuery DOM traversal.
We'll use this list of presidents to practice.
Complete the following exercises in repl. You can always console.log things to verify your selections work.
- Select all of the
tr
elements. - Make the background color of cells in the Name, Term and Party Affiliation columns red, white and blue, respectively.
- Make the check box cells of any Federalist, whig and democratic presidents blue (you can add a class of
blue
) - Make the check box cells of any Democratic-Repbulicans or Republican presidents red (you can add a class of
red
). - Make the whole row of any presidents who served after a president died purple
- If a president is checked, make their column purple.
- Add a new president to the table when you click the 'add president' button (you can hard code their information).
- Remove a president (specified by their number) when you click the 'Remove President' button
- Refactor step 7. Make a form with the number, name, term length and party of your new president.