<div contenteditable="true">
This text can be edited by the user.
</div>
<p contenteditable="true">
Hello
</p>
var content = document.querySelector('[contenteditable]');
// 1. Listen for changes of the contenteditable element
content.addEventListener('input', function(event) {
// 2. Retrive the text from inside the element
console.log(content.innerHTML);
});