Could someone help me to write JS function which will take a string(word) as an argument?
And then add an additional style (change color for example) for all these words in the HTML. I don't know where it is located. This "word" can be inside <div>, or <p> or even <b>.
Example:
HTML:
<p id="p1">Hello World!</p>
<div>Hello World!</div>
function Change(string word){
//change font color to red
}
Call function:
Change("Hello")
Result:
All of the "Hello" words in the HTML have red font color.
By the way, is it possible to write something like this?