const button = document.createElement('button'); button.textContent = 'Click me!'; button.onclick = () => alert('You clicked the button!'); document.body.appendChild(button);