Can we temporarily store data on browser ? For an example , i have page A and page B
On page A(a.html) , i would want to temporarily store text "Helloworld" on button click
function a(){
return "helloWorld"
}
function changePage(){
a()
window.location(b.html)
}
On page B(B.html), i would want then to capture "Helloworld" on page A and print it on page b.
console.log(a())
I read on postMessage but based on my understanding , this only works on 2 page thats loaded on a single page on cross-domain workaround.