Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

check if element with class has another class javascript


        
            
        
     const div = document.querySelector('div');
div.classList.contains('secondary'); // trueCode language: JavaScript (javascript)
Source by www.javascripttutorial.net #
 
PREVIOUS NEXT
Tagged: #check #element #class #class #javascript
ADD COMMENT
Topic
Name
3+2 =