what's wrong with my code..? the div with a anchor tag with a img does not popup in the section area when i call this function
function addLink(){
  if(localStorage.getItem('howManyLinks') >= 1){
    localStorage.setItem('howManyLinks', Number(localStorage.getItem('howManyLinks')) + 1);
  }
  else{
    localStorage.setItem('howManyLinks', '1');
  }
  var howManyLinks = localStorage.getItem('howManyLinks');
  var myNewLink = document.getElementById("link");
    localStorage.setItem('link'+howManyLinks, myNewLink.value);
  var myNewIcon = document.getElementById("icon");
    localStorage.setItem('icon'+howManyLinks, myNewIcon.value);
/* below here is where i have trubble */
  var div = document.createElement('div');
  var img = document.createElement('img');
  var a = document.createElement('a');
  img.setAttribute('src','icon'+howManyLinks);
  a.setAttribute('href','link'+howManyLinks);
  section.appendChild(div);
  div.appendChild(a);
  a.appendChild(img);
}
 
    