This repository has been archived on 2025-05-16. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
pi-race-timer/app/static/js/fahrer.js
2025-04-29 23:36:37 +02:00

17 lines
661 B
JavaScript

function addFahrer() {
const fahrerListe = document.getElementById("fahrerListe");
const index = fahrerListe.children.length + 1;
const farben = ["#ff0000", "#00ff00", "#0000ff", "#ffa500"];
const neueFarbe = farben[index % farben.length];
const div = document.createElement("div");
div.className = "fahrer-eintrag";
div.innerHTML = `
<label>Fahrer ${index}:
<input type="text" name="name" value="Fahrer ${index}">
<input type="number" name="nummer" value="${10 + index}">
<input type="color" name="farbe" value="${neueFarbe}">
</label>
`;
fahrerListe.appendChild(div);
}