js点击历史记录

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>history对象</title>
</head>
<input type="button" id="btn" value="获取历史记录">
<body>


<script>
var btn=document.getElementById("btn");
btn.onclick=function () {
var length= history.length;
alert(length);
}
</script>
</body>
</html>

 

       

posted @ 2019-11-30 18:06  菜鸟不忘初心  阅读(1291)  评论(0编辑  收藏  举报