This repository has been archived on 2024-04-05. You can view files and clone it, but cannot push or open issues/pull-requests.
score-tracker/public/scripts/manage/team.js

18 lines
445 B
JavaScript

import * as Data from "../data.js";
const sportDropdown = document.getElementById('sport-dropdown');
async function listSports() {
sportDropdown.innerHTML = "";
const sportsList = await Data.getSports();
sportsList.forEach(sport => {
const option = document.createElement('option');
option.text = sport.name;
option.value = sport.id;
sportDropdown.appendChild(option);
});
}
listSports();