Question
The purpose of this assignment is to show a basic ability to use the DOM to access and manipulate HTML elements. The assignment is broken
The purpose of this assignment is to show a basic ability to use the DOM to access and manipulate HTML elements.
The assignment is broken down into 2 sections, each worth 5 points for a total of 10 points.
1. Get an HTML Item using a DOM Method. - 5 pts
Use any built-in Javascript DOM Method to "get" an element in an HTML document, that is, to locate the element on the page and assign it to a variable that can be used to manipulate that element.
The relevant list of DOM methods is available in this documentation: https://developer.mozilla.org/en-US/docs/Web/API/Document (Links to an external site.)Links to an external site.
Hint: you'll want to use the methods that start with 'document.get...' for this part of the task.
2. Change an HTML element using a DOM Element Method. - 5pts
Perform any manipulation on the element you've located using element-level DOM methods. Once you've located the element and assigned it to a variable, you now have an Element Object that has built-in Javascript methods. You can use these methods to change aspects of the element like its inner HTML (that is the text inside of a given set of HTML tags), its class attribute, or set any attribute you want. Some of the methods you could use are documented here:
https://developer.mozilla.org/en-US/docs/Web/API/Element
A complete submission for this assignment will include an HTML file and the corresponding Javascript file that finds and manipulates an element in the HTML file.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started