WYSIWYG editor

by Richard Hunter

HTML

<h1>
Very Simple WYSIWYG editor!
</h1>
<textarea id='editor'></textarea>
<div id="display"></div>

CSS

#editor {
  
  width : 100%;
  height : 200px;
}
#display {
  background : pink;
  height : 200px;
  width : 100%;
  overflow-y: auto;
  
}

JavaScript

let editor = document.getElementById('editor');
let display = document.getElementById('display');
editor.addEventListener('input', function () {
	display.innerHTML = event.target.value
});