Код: Выделить всё
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;
});
}
Код: Выделить всё
querySelectorAll("ss")Почему мой JavaScript-запросSelectorAll не выбирает элементы по идентификатору?
Подробнее здесь: https://stackoverflow.com/questions/798 ... ents-by-id
Мобильная версия