$(document).ready(function () { feather.replace(); $(".password-wrapper").each(function () { const $wrapper = $(this); const $passwordInput = $wrapper.find('input[type="password"]'); const $passwordIcon = $('' + '' + '' + ''); $wrapper.append($passwordIcon); feather.replace(); $passwordIcon.find(".feather-eye").on("click", function () { $(this).hide(); $passwordIcon.find(".feather-eye-off").show(); $passwordInput.attr('type', 'text'); }); $passwordIcon.find(".feather-eye-off").on("click", function () { $(this).hide(); $passwordIcon.find(".feather-eye").show(); $passwordInput.attr('type', 'password'); }); }); });