text: var addChannelButton = document.querySelector('.add-channel-button');
  var submitButton = document.querySelector('.submit-button');
  var form = document.querySelector('form');
  var youtubeChannelContainer = document.querySelector('.youtube-channel-container');
  var removeChannelButton = document.querySelector('.remove-channel-button');
  
  var numberOfYoutubeChannels = 1;
  var isLoading = false;
  
  
  
  function addYoutubeSection(){
    numberOfYoutubeChannels++;
    var youtubeChannelString = '<div class="youtube-content-'+numberOfYoutubeChannels+'"><div class="separator"></div><div class="field-set-title"><div class="field-title-2">Youtube details</div><span class="remaining-border remaining-border-2"></span></div><div class="flex-container"><input class="input" required="required" aria-required="true" placeholder="Youtube Channel Link*" type="text" name="youtube-channel-link-'+numberOfYoutubeChannels+'"  autocomplete="off"><input class="input" required="required" aria-required="true" placeholder="Integrated Video Price*" type="number" name="integrated-video-price-'+numberOfYoutubeChannels+'"  autocomplete="off"><input class="input non-required-fields" placeholder="Dedicated Video Price" type="number" name="dedicated-video-price-'+numberOfYoutubeChannels+'"  autocomplete="off"><input class="input non-required-fields" placeholder="Pre Roll Price" type="number" name="pre-roll-price-'+numberOfYoutubeChannels+'" autocomplete="off"><select name="category-'+numberOfYoutubeChannels+'" class="select-with-options" required="required" aria-required="true"><option value="">Select Categories*</option><option value="Travel">Travel</option><option value="Gaming">Gaming</option><option value="Roasts">Roasts</option><option value="Vines">Vines</option><option value="Pranks">Pranks</option><option value="Motivation">Motivation</option><option value="News">News</option><option value="Moto-Vlogs">Moto-Vlogs</option><option value="Beauty">Beauty</option><option value="Vlogs">Vlogs</option><option value="Finance">Finance</option><option value="Technology">Technology</option><option value="Experiment">Experiment</option><option value="Health and Fitness">Health and Fitness</option><option value="Music">Music</option></select></div></div>';
    youtubeChannelContainer.insertAdjacentHTML( 'beforeend', youtubeChannelString);
  
  }
  
  
  
   addChannelButton.addEventListener('click', function(e) {
    e.preventDefault();
    e.stopPropagation();
    addYoutubeSection();
  })
  
  
  removeChannelButton.addEventListener('click', function(e) {
    e.preventDefault();
    e.stopPropagation();
    //addYoutubeSection();
    if(numberOfYoutubeChannels > 1){
      var classOfYoutubeSection = '.youtube-content-'+numberOfYoutubeChannels;
      var youtubeSectionToDelete = document.querySelector(classOfYoutubeSection);
      youtubeSectionToDelete.remove();
      numberOfYoutubeChannels--;
  
    }
  })
  
  
  
  form.addEventListener('submit', function(e) {
    e.preventDefault();
    e.stopPropagation();
    submitButton.submitButton = true;
    submitButton.classList.toggle('button--loading');
    
    var allInvalidFields = form.querySelectorAll(':invalid');
    
    if(allInvalidFields.length === 0){
      alert('all data is valid');
    } else {
      alert('please correct the fields marked in red');
    }
  
    submitButton.submitButton = false;
    submitButton.classList.toggle('button--loading');
  
    
  })
  
  