login.html
<body>
<form action="index.html">
用户名:<input type="text" name="usname">
<input type="submit" value="登录">
</form>
</body>
index.html
<body>
<div>
</div>
<script>
var div=document.querySelector('div')
console.log(location.search);//?usname=wangcat
//1.先去掉? substr('起始位置',截取几个字符)
var params=location.search.substr(1)
//2.利用=把字符传分割成数组 split('=')
var arr=params.split('=')
div.innerHTML=arr[1]+'欢迎您'
</script>
</body>