Spaces:
Runtime error
Runtime error
console.log('DOMContentLoaded'); | |
document.addEventListener('DOMContentLoaded', function() { | |
var buttonGenerate = document.getElementById('button_generate'); | |
var clickedOnce = false; // 用来追踪按钮是否被点击过一次 | |
buttonGenerate.addEventListener('click', function() { | |
if (!clickedOnce) { | |
this.innerText = 'Redo'; | |
clickedOnce = true; // 更新状态为已点击 | |
} | |
}); | |
}); |