JSFiddle - React, Tailwind, and code Playground

by DupontTD

HTML

<p>premier</p>
<p>second</p>

JavaScript

function find(node, string) {
       if (node.innerHTML.indexOf(string) > -1) {
         node.style.color="red";}
       for (n of node.children) {
          find(n, string);}}
console.log(find(document.body, "second"));