请老师看一下被
来源:3-3 编程练习
小仙女要好好学习
2019-07-29 12:01:56
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>history1</title>
</head>
<body>
<a href="history2.html">前往页面2</a>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>history2</title>
</head>
<body>
<a href="history3.html">前往页面3</a>
<input type="button" value="回到页面1" id="btn">
<script>
var btn=document.getElementById("btn");
btn.onclick=function(){
history.back();
}
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>history3</title>
</head>
<body>
<input type="button" value="回到页面1" id="btn">
<input type="button" value="回到页面2" id="btn1">
<script>
var btn=document.getElementById("btn");
btn.onclick=function(){
history.go(-2);
}
var btn1=document.getElementById("btn1");
btn1.onclick=function(){
history.back();
}
</script>
</body>
</html>
1回答
好帮手慕嘟嘟
2019-07-29
同学你好,老师运行了你的代码,效果是正确的,继续努力哦~
如果我的回答帮助了你欢迎采纳,祝学习愉快~