Skip to content

Instantly share code, notes, and snippets.

@danilor
Last active July 21, 2020 20:30
Show Gist options
  • Save danilor/4c4002a61e7d79d237ffd53ec47afcaf to your computer and use it in GitHub Desktop.
Save danilor/4c4002a61e7d79d237ffd53ec47afcaf to your computer and use it in GitHub Desktop.
function removeSelector( s ){
try{
var elem = document.querySelector( s );
elem.parentNode.removeChild(elem);
}catch(e){
console.log( e );
}
}
function removeBodyClass(){
try{
document.getElementsByTagName('body')[0].classList.remove("tp-modal-open");
}catch(e){
console.log( e );
}
}
removeSelector( '.tp-modal' );
removeSelector( '.tp-backdrop' );
removeSelector( '#gdpr-cookie-message' );
removeBodyClass();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment