There are several ways to achieve the task :
1) local storage. Save varibale in local storage and use it when in different page
2) Send your data or set your data in the backend DB like MYSQL/ MONGO and refetch it when on another page.
3) If the data is small and you are using a p.roper framework like angular,enyo then you can save it in you model and reuse it on another page.
4) If yours is a SPA and you are just replacing part of the html then you can save you data inside HTML5 data attribute.