Set to localStorage
localStorage[tovarid] = value;
How can I display it in a div
on my page without reloading the page, immediately, just if I get the value and output, I need to reload the page.
Set to localStorage
localStorage[tovarid] = value;
How can I display it in a div
on my page without reloading the page, immediately, just if I get the value and output, I need to reload the page.
localStorage
works regardless of page reload. The only thing that will prevent getting the value stored in localStorage
is closing the browser. PS Do not confuse localStorage
with sessionStorage
.
Source: https://ru.stackoverflow.com/questions/550904/
All Articles
localStorage.setItem('test', 'myTestValue'); console.log(localStorage.getItem('test'))
localStorage.setItem('test', 'myTestValue'); console.log(localStorage.getItem('test'))
- immediately displays the value of thetest
key that you entered before the output ..... can you have before the reboot and the values you don’t have that you are trying to deposit in the repository? - Alexey Shimansky