JSFiddle - React, Tailwind, and code Playground
HTML
<nav>
<a>afsa</a>
</nav>
CSS
.current {
color: red;
}
JavaScript
var childNodes = document.getElementsByTagName('nav')[0].childNodes;
for (var i = 0; i < childNodes.length; i++) {
console.log(childNodes[i].nodeType);
if (childNodes[i].nodeType !== 3) {
childNodes[i].className = "current";
}
}