1
2<div class="signin-form u-password p-relative">
3 <span class="view-password"><i class="fas fa-eye"></i></span>
4 <input id="pass" class="pass" type="password" placeholder="Enter your password"/>
5</div>
6
7$('.view-password').on('click', function () {
8 let input = $(this).parent().find(".pass");
9 input.attr('type', input.attr('type') === 'password' ? 'text' : 'password');
10});
1 $("#showpaswd").click(function () {
2 var x = document.getElementById("cpassword");
3 if (x.type === "password") {
4 x.type = "text";
5 } else {
6 x.type = "password";
7 }
8 });