+ 2
Why querySelectorAll property is not working 🙁
Really Javascript is very confusing language... sometimes I can not understand why it's not working even though I write Correct properties, tags, classNames 🤔? https://code.sololearn.com/WPpRrYWR96y7/?ref=app
4 Antworten
+ 1
Try this :
const lists = document.querySelectorAll(".hello")
const listItem = [...lists].map(el=>el.style= "background-color:red;");
+ 4
You wrote javascript in style tag 😅
it should be in script tag
and querySelectorAll returns array so you need to iterate through it
+ 3
Thanks a lot to clear my doubts and solve my problems 😇
+ 2
Oh sorry.... 🤭😛