Is there a way to check the DOM for a class name containing the string "cookie"?, it can be .cookiesaved, .cookie-notice , .cookie-set , whatever as long as it contains the word "cookie" i need it to return true
, and must be a class so i cannot use indexOf
of the whole html document.
Also I can't use jQuery, so i'm trying to find a way via pure js.
What I'm trying to do is to check if the page has a cookie banner or not basically, and I couldn't come up with a better idea than checking for that class string so far.