Hier ist mein Code:
Code: Select all
Paragraph 1
Paragraph 2
other person. Min15 characters.
Why is my JavaScript querySelectorAll not selecting elements by ID?
Body*
Paragraph 3
Change the color
function changeOne() {
let firstPara = document.querySelectorAll("ss");
firstPara.forEach(function(p) {
let randomColor = "#" + Math.floor(Math.random() * 16777215).toString(16);
p.style.color = randomColor;
});
}
Code: Select all
querySelectorAll("ss")
Mobile version