I have a class, and if it exists, I want to use the variable as a true / false if statement.
HTML
<div id="snake" class="snake--mobile">
Js
var isMobileVersion = document.getElementsByClassName('snake--mobile'); if (isMobileVersion !== null) alert('xx');
However, it does not work. Any ideas? There are no answers to jQuery.
source share