I am trying to make a button (id=”delete”) that will clear any text entered in my field (id=”input”), I have made a function and button, however after pressing the button nothing happens. Can’t find the issue, the console also doesn’t give any errors. Will be thankful for your assistance.
HTML:
<span contenteditable="true" ><p id="input"></p></span>
<button id="delete">Delete Data</button>
JS:
const trigger =
document.getElementById("delete");
trigger.value = '';
Thanks!