I followed some tutorials to get the viewer in the input Like this one here: link However when I run on my pc it gives the following error:
Code:
I followed some tutorials to get the viewer in the input Like this one here: link However when I run on my pc it gives the following error:
Code:
It was just for an onloadm because the code was trying to get the value before loading the DOM
window.onload=function(){
var input = document.querySelector('#input input');
var img = document.querySelector('#input img');
var visivel = false;
img.addEventListener('mousedown', function () {
visivel = true;
input.type = 'text';
});
window.addEventListener('mouseup', function (e) {
if (visivel) visivel = !visivel;
input.type = 'password';
});
}