music.html
跳转
<input type="text" id="input"><script>var input=document.getElementById("input");input.onkeydown=function(event){if(event.keyCode==13){console.log(this.value);location.href=`search.html?s=${this.value}` //主要是这一段代码}}
search.html
传值
<p>搜索</p><script>console.log(location.search.split("=")[1])var keyword=location.search.split("=")[1];var c=decodeURIComponent(keyword);console.log(c);</body></html>
