toggle password/text with javascript only – Jquery
I'd like to change the following code to javascript only: $(document).ready(function() { $('.fa-eye, .fa-eye-slash').click(function() { $(this).toggleClass('fa-eye fa-eye-slash'); var input=$(this).parent().find('input'); if(input.attr('type')=='password') { input.attr('type', 'text'); }else input.attr('type', 'password'); }); }); What is does is when you click in an "eye icon" it…