This repository has been archived on 2024-04-05. You can view files and clone it, but cannot push or open issues or pull requests.
score-tracker/public/scripts/manage/team.js
2021-11-22 19:17:23 -07:00

18 lines
No EOL
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();