+ 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.... š¤š