JSFiddle - React, Tailwind, and code Playground
HTML
<div class=somediv>
<div class="jn Gs">Linus Torvalds</div>
<div class="jn Gs">I'm sexy and I know it</div>
<div class="jn Gs">Lorem ipsum</div>
</div>
JavaScript
var divs = document.getElementsByTagName('div');
for (var i=0, len=divs.length; i<len; i++){
var current = divs[i];
if (current.className == 'jn Gs') {
switch (current.firstChild.nodeValue) {
case 'Linus Torvalds':
current.firstChild.nodeValue = 'The ' + current.firstChild.nodeValue;
break;
case "I'm sexy and I know it":
current.firstChild.nodeValue += ' sure';
break;
default:
current.firstChild.nodeValue += ' WTF';
break;
}
}
}