You are going to be emulating a content managment system by controlling the content in the JavaScript file instead of the HTML file. This project is an excercise pointed at selecting elements and then updating them without touching the HTML file using the DOM.
You have been provided a JSON object with all the necessary data to accomplish this task. Use dot or bracket notation to traverse the data provided.
ONE RULE: You cannot update the HTML or CSS files directly. You must use JavaScript and the DOM only for your tasks today.
- Fork the project into your GitHub user account
- Clone the forked project into a directory on your machine
- You are now ready to build this project with your preferred IDE
- Create selectors by using any of the DOM element's methods
- Note that IDs have been used on all images. Use the IDs to update src path content
- Remember, NO direct updating of the HTML source is allowed.
- Using your selectors, update the content to match the example file.
- Remember to update the src attributes on images
- Change the color of the navigation text to be green.
- [] Utilize
.appendChild()
and.prepend()
to add two new items to the navigation system. You can call them whatever you want. - Check your work by looking at the original html in the browser
- Update styles throughout the page as you see fit. Study what happens when you updated the DOM using style in JavaScript.
- Study tomorrow's lesson on events and try to integrate a button that can update content on the site with a click of a button. You could build a similar data object with new values to help you test the click event.
This project is heavier on logic but employs some DOM manipulation to achieve it's goals. Go check it out here: stretch assignment and see how far you can get.