JSFiddle - React, Tailwind, and code Playground

by techiedelight

HTML

<!doctype html>
<html lang="en">
<body>
  <div id="container"></div>
</body>
</html>

CSS

.btn-styled {
  font-size: 14px;
  margin: 8px;
  padding: 0 10px;
  line-height: 2;
}

JavaScript

document.addEventListener('DOMContentLoaded', function() {
  var button = document.createElement('button');
  button.type = 'button';
  button.innerHTML = 'Press me';
  button.className = 'btn-styled';

  button.onclick = function() {
    // ...
  };

  var container = document.getElementById('container');
  container.appendChild(button);
}, false);