老师看下写对了吗
来源:2-7 编程练习
直鹢
2019-04-12 15:33:50
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>location方法</title>
</head>
<body>
<input type="button" value="操作页面" id="ck">
<script type="text/javascript">
//补充代码
document.getElementById('ck').onclick=function() {
var add=window.confirm("刷新页面吗?");
if (add==true) {
location.reload()
}else{
location.replace("http://www.imooc.com");
}
}
</script>
</body>
</html>1回答
同学你好~
代码写对了,效果实现很好~
如果帮助到了你欢迎采纳,祝学习愉快~
相似问题