📅  最后修改于: 2022-03-11 15:04:19.158000             🧑  作者: Mango
let button = document.createElement('button');
button.textContent = 'Like';
document.body.appendChild(button);
button.addEventListener('click', () => {
if (button.textContent === 'Like') {
print('Liked!');
} else {
print('Like');
}
});
}