+ 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 Answers
+ 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.... đ€đ