Update 2025-04-13_16:41:14
This commit is contained in:
17
static/button.js
Normal file
17
static/button.js
Normal file
@ -0,0 +1,17 @@
|
||||
// button.js
|
||||
// Modularer Button-Helper für dynamische UI-Erweiterung
|
||||
|
||||
function createButton(id, label, onClick) {
|
||||
const btn = document.createElement("button");
|
||||
btn.id = id;
|
||||
btn.textContent = label;
|
||||
btn.addEventListener("click", onClick);
|
||||
return btn;
|
||||
}
|
||||
|
||||
function insertButton(containerId, id, label, onClick) {
|
||||
const container = document.getElementById(containerId);
|
||||
if (!container) return;
|
||||
const btn = createButton(id, label, onClick);
|
||||
container.appendChild(btn);
|
||||
}
|
Reference in New Issue
Block a user