- 1
Why is it only one <p> that gets highlighted?
Searching string highlight. Only content from the first <p> element is affected. How to overcome this?
5 Antworten
+ 1
You need to use querySelectorAll() to get all the <p> elements which have the class you're looking for. You've used querySelector() which returns the first one if it finds one.
0
Your code link?
0
Ohh shoot.. sorry. I copied, forgot to paste. Haha
https://code.sololearn.com/WAsn5UEVfvdk/?ref=app
0
Ahh! Thanks!!
0
No problem. Glad I could help 🙂