Site URL: https://ngapsms.com
Hey All!
I'm struggling with the following code:
<!--
<style>
.sqs-cookie-banner-v2.DARK {
display: none;
}
</style>
-->
<script>
//check if running gonative
if (navigator.userAgent.indexOf('gonative') > -1) {
//hide cookie banner
$(".sqs-cookie-banner-v2.DARK").hide();
console.log("yes gonative");
} else {
//show cookie banner
$('.sqs-cookie-banner-v2.DARK').show();
console.log($('.sqs-cookie-banner-v2.DARK').attr('style'));
console.log("no gonative");
}
</script>
I've loaded 3.6.0 jQuery and I'm loading this code in the footer of my site.
What I find is that the jQuery selector on class' doesn't seem to work. I can select all p's or h2's tags and it works great, but using class' fails consistently. Also, the commented style does work, so it makes me feel like the class is correct.
Should this work, or is there something that I'm missing?