Toggle Password Visibility is most commonly used in most sites to show you that you can crosscheck whether you have written the correct password. It is a very simple JavaScript code as you can see we created a function and in that function we have just called the document.getElementById in a variable and we will get what ever password is written in that input type.
Code for Toggle Password Visibility using JavaScript Copy
<!DOCTYPEhtml>
<html>
<body>
<h1>Toggle Password Visibility using JavaScript</h1>
<p>Click the radio button to toggle between password visibility:</p>