Set Persistent Variable in Javascript

(function(window, document, $, undefined){
    'use strict';

    if ( window.name ) {
        alert( 'Welcome back, '+ window.name +'!' );
    }

    $( 'body' ).on( 'change', 'input[name="name"]', function( evt ) {
        window.name = $(this).val();
    });

})(window, document, jQuery);