JSFiddle - React, Tailwind, and code Playground

by Martin Emanuelsson

HTML

<div id="flash">
<p id="text" class="red">Hi this text should be replaced when page and DOM is loaded.</p>
</div>

CSS

#flash { margin:2em auto;
background-color:#FFF;
border:1px solid #CCC;
padding:1em;
border-radius:10px;
border-width: 1px 1px 2px;}

.red { color:red; }
.green { color:green; }

JavaScript

'use strict';
  var text;
  text = document.getElementById('text');
  text.innerHTML = 'Hello World, document is ready!';
  text.className = 'green';
  console.log('Everything is ready.');