to store the values which one is good place local storage or session storage code example
Example: what is local storage and session storage in javascript
//localStorage - stores data with no expiration date. window. sessionStorage - stores data for one session (data is lost when the browser tab is closed)