I'm currently working on a login screen for an app that has a feature where clicking the "Not You?" button brings up a text-box to update the username displayed. However, I am facing an issue where the username only updates once and then fails to work again. Can anyone help identify what's incorrect with my jQuery code?
Here is the jQuery code in question:
var main = function(){
$('.not').click(function(){
$('.login-wrap').fadeOut(300, function(){
$('.not-you').fadeIn(300);
});
});
$('.enter').click(function(){
$('.name').replaceWith($('.new-input').val());
$('.not-you').fadeOut(300, function(){
$('.login-wrap').fadeIn(300);
});
});
}
$(document).ready(main);
You can find the CodePen link HERE.
Appreciate the assistance!