title: How to create to select from year to year in html forms?
body: <p>I want to user to input from this year to that and then I need to forward the list of years to django? But before this how to create that kind of input, I have found something like this, but it is not working what I need. Any ideas?</p>
  <pre><code>&lt;select name=&quot;yearpicker&quot; id=&quot;yearpicker&quot;&gt;&lt;/select&gt;
  
  &lt;script type=&quot;text/javascript&quot;
          src=&quot;https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js&quot;&gt; 
  &lt;/script&gt;
  &lt;script type=&quot;text/javascript&quot;&gt;
  let startYear = 1800;
  let endYear = new Date().getFullYear();
  for (i = endYear; i &gt; startYear; i--)
  {
      $('#yearpicker').append($('&lt;option /&gt;').val(i).html(i));
  }
  &lt;/script&gt;
  </code></pre>