Browser storage way many people can say, but not necessarily with such as localStorage read directly on the code a page code

<body> <input type="text" id="name"> <input type="button" id=" BTN "value=" submit "> <script> window.onload = function () { let btn = document.getElementById('btn'); let name = document.getElementById('name') btn.onclick = function () { let nameValue = name.value; localStorage.setItem('name', nameValue) } } </script> </body>Copy the code

B Interface code

<body>
    <script>
        window.onload = function () {
            window.addEventListener('storage', function (event) {
                console.log(event.key + '=' + event.newValue)
            })
        }
    </script>
</body>

Copy the code

Then run files A and B

Enter information in the input box of interface A and click Submit

When you look at the console of interface B, information has already appeared on it