传值页面
<input type="text" name="userName" id="userName" placeholder="用户名">
<script type="text/javascript">
function b(){
var ad = document.getElementById('userName').value;
window.location.href = `页面的地址?username=${ad}`
}
</script>
接收值得页面:
<span id="username"></span>
var data = window.location.href.split("?")[1].split("=")[1];
var username = document.getElementById('username');
username.innerHTML = data;