I am working on a django application. I added a login page to the application. In the login page I want to add a show password checkbox which when checked shows the password. I have written some javascript code for that purpose. this is the code to show passowrd
js code to show passowrd
function myFunction() {
var x = document.getElementById("myInput");
if (x.type === "password") {
x.type = "text";
} else {
x.type = "password";
}
}
Now my problem is this code only works if the password field has the id myinput
. How do I add this to django's built in login form?