$('#remember_me').click(function() {

  if($('#remember_me').is(':checked')) {

    localStorage.username = $('#user_name').val();

    localStorage.password = $('#password').val();

    localStorage.chkbx = $('#remember_me').val();

  } else {

    localStorage.username = '';

    localStorage.password = '';

    localStorage.chkbx = '';

  }

});