js页面点击完自动刷新
以下是基础的 HTML 和 JavaScript 代码,可以在页面点击后自动刷新:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>自动刷新页面</title>
</head>
<body>
<h1>点击按钮自动刷新页面</h1>
<button onclick="location.reload()">刷新页面</button>
</body>
</html>
这里使用了 location.reload() 方法来刷新页面。当点击按钮时,这个方法会被调用,从而让页面重新加载。
原文地址: https://www.cveoy.top/t/topic/bkLq 著作权归作者所有。请勿转载和采集!