window.location.search.includes('cro_mode=qa') // or window.location.search.indexOf('cro_mode=qa') > -1 // finding it in cookies: function getCookie(name) { const value = `; ${document.cookie}`; const parts = value.split(`; ${name}=`); if (parts.length === 2) return parts.pop().split(';').shift(); } //then... getCookie('cro_mode') //or something like ... const parts = document.cookie.split('cro_mode'); if (parts.length === 2) {console.log(parts.pop().split(';').shift())}