Preventing paste into an input field See the codepen: https://codepen.io/JSsnippets/pen/qBbyMoJ const pasteBox = document.getElementById("paste-no-event"); pasteBox.onpaste = (e) => { e.preventDefault(); return false; }; Source https://github.com/roeib/JavaScript-snippets#preventing-paste-into-an-input-field