+ 1
Is there a way to check there are any red color text in the website
I want to check that the website has any coloured text. If found then it should return a Boolean value. Is that possible using javascript
2 Answers
+ 2
Yes it's possible.
My approach:
Traverse the entire Dom tree and check textNode by textNode for color red.
You can use getComputedStyle(node).color for that:
https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle
https://code.sololearn.com/WVUCihKrAcXZ/?ref=app
+ 2
Kevin â
Thanks for answering my question.