You could use the query part of the URL to "send" data to another page:
a.html
:
<form action="b.html" method="get">
<input type="text" name="mytext">
<button>send</button>
</form>
b.html
:
<p id="mytxt"></p>
<script>
document.getElementById('mytxt').appendChild(document.createTextNode(new URL(location.href).searchParams.get('mytext')))
</script>
However, this has its own limits. E.g. URL's length should be under 2000 characters, and if somebody revisits the generated link, the same text will appear.
If you have access to some server-side language/configuration, you can make a POST
request instead, and manipulate b.html
on the server.
If you have to stick to front-end, you could also try something with the Session Storage, and a redirection using JS.