JSFiddle - React, Tailwind, and code Playground

by Kevin Faulhaber

HTML

<button id="show">Show</button>
<ul id="future_drop_down">
</ul>

JavaScript

var button = document.getElementById('show');

var days = prompt('number of days? ');
var tar = document.getElementById("future_drop_down");
tar.style.visibility = 'hidden';
recursive(tar, 1, days);
function recursive(target, idx, days)
{
    if(idx <= days)
    {
      var temp = document.createElement('li');
      temp.innerHTML = idx;
      target.appendChild(temp);
      recursive(target, idx+1, days);
    }
}

button.onclick = function(){
    if(tar.style.visibility === 'visible')
    {
        
        tar.style.visibility = 'hidden';        
    }
    else
    {
         tar.style.visibility = 'visible';
    }
};