A
A
anna4582020-05-07 16:40:17
JavaScript
anna458, 2020-05-07 16:40:17

I can't figure out the DOM but I don't understand, what's wrong?

Task description:

Select 3 DOM elements:
- move to the element with id = "test" and assign the selected element to change id.

- return to element after class class = "test" and assign selected element to change className

- return to element after tag and assign selected element to change tag

My Response:
var test = document.getElementById("test");
var test = document.getElementByclassName("test");
var_tag = document.getElementByTagName("div");

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Motilyda, 2020-11-21
@Motilyda

var id = document.getElementById("test");
var className = document.getElementsByClassName("test");
var tag = document.getElementsByTagName('div');
Here is the correct answer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question