JSFiddle - React, Tailwind, and code Playground

by Matt Ball

HTML

<h3>
    Random number from 0 to 9:
    <span id="foo"></span>
</h3>

CSS

h3 {
    text-align: center;
}

#foo {
    color: red;
}

JavaScript

window.onload = function ()
{
    var output = document.getElementById('foo');

    setInterval(function ()
    {
        output.innerHTML = Math.floor(Math.random() * 10);
    }, 1000);
};