JSFiddle - React, Tailwind, and code Playground

by Ender

HTML

<ul id="lines_list" class="one nojavaScript two">
    <li>One</li>
    <li>Two</li>
    <li>Three</li>
</ul>

CSS

.nojavaScript li { background-color: yellow; }

JavaScript

function removeClass(elem, className) {
        //declare some regexes to help us strip the extra whitespace
        var trimLeft = /^\s+/,
            trimRight = /\s+$/,
            stripDouble = /\s+/g;
        //remove the class, strip extra whitespace, and reassign className
        elem.className = elem.className.replace(className, '').replace(trimLeft, '').replace(trimRight, '').replace(stripDouble, ' ');
    }

    //declare name of class to remove and get an array of elements with that class
    var toRemove = 'nojavaScript',
        elArr = document.getElementsByClassName(toRemove);

    //iterate over elements and remove the class
    for (var i = 0; i < elArr.length; i++) {
        removeClass(elArr[i], toRemove);
    }