hide banner from screen

hide banner from screen


Hi please help, I am trying to hide a banner on my page see line 6 below my code is getting into the else  but it's not hiding the banner
  1. var covidId = $(".covid-popup").attr('id');
  2.         //POPUP ONLY ONCE
  3.         if(localStorage.getItem('popState') != 'shown'){
  4. $('#'+ covidId +'').show();
  5.         } else {
  6. $('#'+ covidId +'').hide();
  7.         }