JSFiddle - React, Tailwind, and code Playground

by lun471k

HTML

<div id="test" class="toaster"></div>
<div class="toaster"></div>

JavaScript

var toasts = document.querySelectorAll('.toaster');

for(var i in toasts)
    toasts[i].innerHTML = '<span style="color:blue">hey! </span>';

document.querySelector('#test').style.backgroundColor = '#ddd';