Skip to content

Instantly share code, notes, and snippets.

@atsea
Created July 28, 2017 14:15
Show Gist options
  • Save atsea/7af97d7cadb797777ad54def302ef9b5 to your computer and use it in GitHub Desktop.
Save atsea/7af97d7cadb797777ad54def302ef9b5 to your computer and use it in GitHub Desktop.
Pass field text value to another page using localstorage.
/**
* PASS TITLE TO ANOTHER PAGE
*
* Saves title text from form via localStorage to display on success page.
* @type {Object}
*/
var m={title:$('.udel--title h1').text()};
localStorage.setItem('udel_frm_title', JSON.stringify(m));
//GET
var gm =JSON.parse(localStorage.getItem('udel_frm_title'));
console.log('title' + gm.title);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment