Removing the copy/paste JavaScript events associated with a password input field of a form

Published on 2024-05-07 • Modified on 2024-05-07

This snippet shows how to remove the copy/paste JavaScript events associated with a form's password input field.
It is so dull that websites still prevent this and the use of a password manager. Check out the Stackoverflow answer for more details, but this is the most straightforward solution.


let inputElement = document.getElementById('password')
const clone = inputElement.cloneNode(true)
inputElement.replaceWith(clone)

 More on Stackoverflow   Read the doc  More on the web  Random snippet

  Work with me!


Call to action

Did you like this post? You can help me back in several ways: (use the "reply" link on the right to comment or to contact me )

Thank you for reading! And see you soon on Strangebuzz! 😉

COil