const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); if(urlParams.get('qr')){ window.location.href = 'https://qrcodegeneratorhub.com/i/' + urlParams.get('qr'); }else{ document.getElementsByClassName('o2ohub-processing')[0].style.display = 'none'; } .o2ohub {text-align: center;} Processing QR Code.... Download Created by QR Code Generator Hub var toHideElement = 'o2ohub-qr-code'; if(!urlParams.get('qr')){ toHideElement = 'o2ohub-processing' } document.getElementsByClassName(toHideElement)[0].style.display = 'none';