JSFiddle - React, Tailwind, and code Playground

by Tushar Gupta

HTML

<div class="html" contenteditable="true">
	
</div>

<div class="result">
	
</div>

CSS

body{
	margin:0;
}

.html{
	height:50vh;
	width:100vw;
	background-color:#1a1a1a;
}

.result{
	height:50vh;
	width:100vw;
	background-color:#f5ff5;
}

JavaScript

$(document).ready(function() {
  const el = $("div.html");
  const result = $(".result");
  el.keydown(function(event) {
    if (event.keyCode === 27 && event.ctrlKey) {
      result.html(el.text())
    }
  })
})