index.js
// fill in modal body with details
fill in modal body with details
fill in modal body with details
function renderModal(dbResults) {
  innerContent.innerHTML = '';
  for (i=0; i<dbResults.length; i++) {
    var myEvent = document.createElement('div');
    var p1 = document.createElement('p');
    var p2 = document.createElement('p');
    var p3 = document.createElement('p');
    var remove = document.createElement('button');
    var p1Text = document.createTextNode(dbResults[i].artists + ' @ ' + dbResults[i].city + ', ' + dbResults[i].region);
    var p2Text = document.createTextNode(dbResults[i].formatted_datetime);
    var p3Text = document.createTextNode(dbResults[i].name);
    var remove = document.createElement('button');
    var btnText = document.createTextNode('Remove from calendar');
    remove.classList.add('btn');
    remove.classList.add('btn-secondary');
    remove.id = i;
    p1.classList.add('bold');
    myEvent.classList.add('saved-event');
    p1.appendChild(p1Text);
    p2.appendChild(p2Text);
    p3.appendChild(p3Text);
    remove.appendChild(btnText);
    myEvent.appendChild(p1);
    myEvent.appendChild(p2);
    myEvent.appendChild(p3);
    myEvent.appendChild(remove);
    innerContent.appendChild(myEvent);
    initRemove(remove, dbResults[i].eventId);
  }
}
function renderModal ( dbResults ) { innerContent . innerHTML = '' ; for ( i = 0 ; i < dbResults . length ; i ++ ) { var myEvent = document . createElement ( 'div' ) ; var p1 = document . createElement ( 'p' ) ; var p2 = document . createElement ( 'p' ) ; var p3 = document . createElement ( 'p' ) ; var remove = document . createElement ( 'button' ) ; var p1Text = document . createTextNode ( dbResults [ i ] . artists + ' @ ' + dbResults [ i ] . city + ', ' + dbResults [ i ] . region ) ; var p2Text = document . createTextNode ( dbResults [ i ] . formatted_datetime ) ; var p3Text = document . createTextNode ( dbResults [ i ] . name ) ; var remove = document . createElement ( 'button' ) ; var btnText = document . createTextNode ( 'Remove from calendar' ) ; remove . classList . add ( 'btn' ) ; remove . classList . add ( 'btn-secondary' ) ; remove . id = i ; p1 . classList . add ( 'bold' ) ; myEvent . classList . add ( 'saved-event' ) ; p1 . appendChild ( p1Text ) ; p2 . appendChild ( p2Text ) ; p3 . appendChild ( p3Text ) ; remove . appendChild ( btnText ) ; myEvent . appendChild ( p1 ) ; myEvent . appendChild ( p2 ) ; myEvent . appendChild ( p3 ) ; myEvent . appendChild ( remove ) ; innerContent . appendChild ( myEvent ) ; initRemove ( remove , dbResults [ i ] . eventId ) ; } }
fill in modal body with details
fill in modal body with details
// append to modal