Skip to content

Instantly share code, notes, and snippets.

@russelllim22
Last active December 27, 2021 21:28
Show Gist options
  • Save russelllim22/39c1737908f4b80263400d1bd52216e7 to your computer and use it in GitHub Desktop.
Save russelllim22/39c1737908f4b80263400d1bd52216e7 to your computer and use it in GitHub Desktop.
<label for="year">
Select a year:
<select id="year" selected="2020" bind:value={selectedYear}
on:change="{
async () => {
letterCounts = [];
let response = await fetch(`names data/yob${selectedYear}.txt`);
let newFile = await response.text();
showBars(newFile);
}
}">
{#each years as year}
<option>{year}</option>
{/each}
</select>
</label>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment