function generate(){
  for(var i = 0; i < namesA.length; i++){
    new Products('img/' + namesA[i] + '.jpg', namesA[i]);
  }
  //creating the text element and appending to the DOM
  for(var i = 0; i < namesA.length; i++){
    var optionList = document.createElement('option');
    optionList.textContent = namesA[i];
    itemList.appendChild(optionList);
  }
}
//takes image ID and creates all the objects 
takes image ID and creates all the objects
takes image ID and creates all the objects
function generate(){
  for(var i = 0; i < namesA.length; i++){
    new Products('img/' + namesA[i] + '.jpg', namesA[i]);
  }
  for(var i = 0; i < namesA.length; i++){
    var optionList = document.createElement('option');
    optionList.textContent = namesA[i];
    itemList.appendChild(optionList);
  }
}
function generate ( ) { for ( var i = 0 ; i < namesA . length ; i ++ ) { new Products ( 'img/' + namesA [ i ] + '.jpg' , namesA [ i ] ) ; } for ( var i = 0 ; i < namesA . length ; i ++ ) { var optionList = document . createElement ( 'option' ) ; optionList . textContent = namesA [ i ] ; itemList . appendChild ( optionList ) ; } }
takes image ID and creates all the objects
takes image ID and creates all the objects
//creating the text element and appending to the DOM