Home

Published

- 1 min read

contenteditable onchange

img of contenteditable onchange

The solution for this is noted below

contenteditable onchange

Solution

   <!-- Use an "input" event listener -->
<div contenteditable="true" id="editor">Please type something in here</div>
<script>
	document.getElementById('editor').addEventListener(
		'input',
		(inputEvt) => {
			console.log('input event fired')
		},
		false
	)
</script>

Try other methods by searching on the site. That is if this doesn’t work