SOURCE

console 命令行工具 X clear

                    
>
console
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>四级单词背诵</title>
<style>
body{text-align:center;padding:30px;font-family:微软雅黑}
button{margin:6px;padding:10px 18px;border:none;border-radius:6px;color:white}
#b1{background:#3478e8}
#b2{background:#28a745}
</style>
</head>
<body>
<h2>四级单词背诵</h2>
<p id="word">点击下一个单词</p>
<button id="b1">查看释义</button>
<button id="b2">下一个单词</button>
<script>
const w=[
  {en:"feasible",cn:"adj.可行的"},
  {en:"rational",cn:"adj.理性的"},
  {en:"constraint",cn:"n.约束"}
];
let idx=0,hide=true;
const p=document.getElementById("word");
function show(){p.innerText=hide?w[idx].en:w[idx].en+" — "+w[idx].cn;}
document.getElementById("b1").onclick=()=>{hide=false;show()};
document.getElementById("b2").onclick=()=>{idx=(idx+1)%w.length;hide=true;show()};
</script>
</body>
</html>