📌  相关文章
📜  'esversion: 6' javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:19.158000             🧑  作者: Mango

代码示例2
let button = document.createElement('button');
    button.textContent = 'Like';
    document.body.appendChild(button);
    button.addEventListener('click', () => {
        if (button.textContent === 'Like') {
            print('Liked!');
        } else {
            print('Like');
        }
    }); 
}