黑马程序员技术交流社区

标题: 【石家庄校区】 [打印本页]

作者: 许多钱    时间: 2019-6-1 14:48
标题: 【石家庄校区】
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>history对象</title>
    <script>
        /*
            History:历史记录对象
                1. 创建(获取) 1. window.history2. history
                2. 方法:
                    * back()   加载 history 列表中的前一个 URL
                    * forward()    加载 history 列表中的下一个 URL
                    * go(参数)       加载 history 列表中的某个具体页面。
                        * 参数:
                            * 正数:前进几个历史记录
                            * 负数:后退几个历史记录
                3. 属性:
                    * length   返回当前窗口历史列表中的 URL 数量。


         */</script>
</head>
<body>
<a href="03电灯.html" > 点击 </a>
<input  id="id" type="button"value="返回" >

<script>
    var id = document.getElementById("id");
    id.onclick=function () {
        history.back()
    }
</script>

</body>
</html>





欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2