JSFiddle - React, Tailwind, and code Playground
HTML
<!--[if IE 8]><script>
document.getElementsByClassName =
Element.prototype.getElementsByClassName = function(class_names) {
// Turn input in a string, prefix space for later space-dot substitution
class_names = (' ' + class_names)
// Escape special characters
.replace(/[~!@$%^&*()_+\-=,./';:"?><[\]{}|`#]/g, '\\$&')
// Normalize whitespace, right-trim
.replace(/\s*(\s|$)/g, '$1')
// Replace spaces with dots for querySelectorAll
.replace(/\s/g, '.');
return this.querySelectorAll(class_names);
};
</script><![endif]-->
<div class="foo"></div>
JavaScript
document.getElementsByClassName('foo')[0].innerHTML = 'Test';