Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js class exists

var isMobileVersion = document.getElementsByClassName('snake--mobile');
if (isMobileVersion.length > 0) {
    // elements with class "snake--mobile" exist
}
Source by codetogo.io #
 
PREVIOUS NEXT
Tagged: #js #class #exists
ADD COMMENT
Topic
Name
4+6 =