history.back() 返回上一页面

  1. //02.html
  2. <p>02</p>
  3. <a href="html/03.html">03.html</a>
  1. //03.html
  2. <p>03</p>
  3. <button id="btn">btn</button>
  4. <script>
  5. var btn = document.getElementById("btn");
  6. btn.onclick = function(){
  7. history.back();
  8. }
  9. </script>