File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -29,11 +29,6 @@ description: Word cloud visualization of blog posts by year.
2929 <label for =" yearSelect " >Select a year:</label >
3030 <select id =" yearSelect " >
3131 <option value="">-- Choose Year --</option>
32- <option value="2024">2024</option>
33- <option value="2023">2023</option>
34- <option value="2022">2022</option>
35- <option value="2021">2021</option>
36- <option value="2006">2006</option>
3732 </select >
3833</div >
3934
@@ -43,6 +38,15 @@ description: Word cloud visualization of blog posts by year.
4338 const canvas = document .getElementById (' wordcloud' );
4439 const yearSelect = document .getElementById (' yearSelect' );
4540
41+ document .addEventListener (" DOMContentLoaded" , () => {
42+ const yearSelector = document .getElementById (" yearSelect" );
43+
44+ const endYear = new Date ().getFullYear ();
45+ for (let year = 2006 ; year <= endYear; year++ ) {
46+ studentSelect .append (new Option (" " + year, " " + year, true , true ));
47+ }
48+ });
49+
4650 yearSelect .addEventListener (' change' , () => {
4751 const year = yearSelect .value ;
4852 if (! year) return ;
You can’t perform that action at this time.
0 commit comments