Add examples for button factory

This commit is contained in:
Steve Kinney
2024-09-30 10:31:43 -06:00
parent 2ca2a233f9
commit c03bb7e8cb
7 changed files with 106 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
export function createButton() {
const button = document.createElement('button');
button.textContent = 'Click Me';
button.addEventListener('click', () => {
button.textContent = 'Clicked!';
});
return button;
}