JSFiddle - React, Tailwind, and code Playground
HTML
<div id="log"></div>
CSS
#log {
height: 256px;
width: 512px;
overflow: auto;
border: 1px solid #ccc;
margin: 15px auto;
padding: 5px;
contenteditable: true;
}
JavaScript
(function() {
var Log = function(id) {
this.log = document.getElementById(id);
};
Log.prototype.write = function(str) {
this.log.innerHTML += str;
};
Log.prototype.writeLn = function(str) {
this.write(str + '<br />');
};
var log = new Log('log');
for(var i = 64; i-- > 0;) {
log.writeLn('Hello JavaScript!');
}
})();