Answers for "onchange for contenteditable div"

2

div contenteditable onchange angular

You can use the input event, like so:
...
<div contenteditable (input)="onNameChange($event.target.innerHTML)">
   Type your name
</div>
Posted by: Guest on April-09-2021
3

contenteditable onchange

<!-- 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>
Posted by: Guest on October-14-2020

Code answers related to "onchange for contenteditable div"

Browse Popular Code Answers by Language