1. <body>
    2. <input type="text" id="app">
    3. <script>
    4. /* 1、点击键盘的enter,获取input的值 */
    5. var app = document.getElementById("app")
    6. app.onkeydown= function(event){
    7. if(event.keyCode==13){
    8. console.log(this.value)
    9. /* 2、将这个值传递给另一个页面 */
    10. location.href = "15search.html?s="+this.value;
    11. }
    12. }
    13. </script>
    14. location.href =" " // 跳转到另一个页面
    15. location.search // 可设置或返回当前 URL 的查询部分(问号 ? 之后的部分)
    16. decodeURIComponent() //解码