one.html <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> New Document </title> </head> <body> <input type="text" id="cc"><button type="button" οnclick="to()">点击</button> <script> function to() { var getval = document.getElementById("cc").value; location.href = "two.html?cc=" + getval; } </script> </body> </html> two.html <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> New Document </title> </head> <body οnlοad="showvalf()"> <input type="text" id="ee" /> <script> var thisURL = document.URL; var getval = thisURL.split('?')[1]; var showval = getval.split("=")[1]; function showvalf() { document.getElementById('ee').value = showval; } </script> </body> </html>