xxxxxxxxxx
const notes = document.querySelectorAll('.note');
const count = notes.length;
for (let i = 0; i < count; i++) {
notes[i].style.backgroundColor = "yellow";
}
Code language: JavaScript (javascript)
xxxxxxxxxx
const notes = document.querySelectorAll('.note');
notes.forEach((note) => {
note.style.backgroundColor = 'yellow';
});
Code language: JavaScript (javascript)
xxxxxxxxxx
[].forEach.call(notes, (note) => {
note.style.backgroundColor = "yellow";
});
Code language: PHP (php)