mongo-express
Version:
Web-based admin interface for MongoDB
16 lines (14 loc) • 477 B
JavaScript
import $ from 'jquery';
$(() => {
$('#togglePassword').click(function () {
const passwordInput = $('#password');
const type = passwordInput.attr('type');
if (type === 'password') {
passwordInput.attr('type', 'text');
$(this).find('i').removeClass('fa fa-eye d-block').addClass('fa fa-eye-slash');
} else {
passwordInput.attr('type', 'password');
$(this).find('i').removeClass('fa fa-eye-slash').addClass('fa fa-eye');
}
});
});