From the backend, I get JSON in the following format: <p>@username This is awesome.</p>
I have to detect @
in a word and then add a class to the entire word or a span so I can modify the word to something like this:
p span {
font-weight: bold;
color: red;
}
<p><span>@username</span> This is awesome</p>
How do I detect using javascript to get this going? Please note that @
could be anywhere in the paragraph.