Rodin / change_button_text.js
skkk's picture
rodin
ff1e8e9
raw
history blame contribute delete
443 Bytes
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; // 更新状态为已点击
}
});
});