Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript hass class

if (myElement.classList.contains('someClassname')) {
    // do something
}
Comment

how to check has class name in js?


        
            
        
     element.classList.contains(className);Code language: CSS (css)
Comment

PREVIOUS NEXT
Code Example
Javascript :: How to download files using axios 
Javascript :: jquery on input 
Javascript :: create copy button react native 
Javascript :: javascript make obj invisible 
Javascript :: jquery text replace 
Javascript :: javascript random alphabet 
Javascript :: javascript clear all intervals 
Javascript :: Javascript - check if div contains a word? - Stack Overflow 
Javascript :: string to kebab case 
Javascript :: get platform node 
Javascript :: capitalize in javascript 
Javascript :: jquery selector all elements except one 
Javascript :: javascript for each key in object 
Javascript :: javascript object syntax example with find 
Javascript :: vue read url 
Javascript :: javascript lowercase string except first letter of every word 
Javascript :: js check query string 
Javascript :: prettier semicolon false in javascript 
Javascript :: add 10 seconds to date javascript 
Javascript :: hashtag strategy angular 
Javascript :: json server npm 
Javascript :: react useeffect not on first render 
Javascript :: set an attribute background image javascript 
Javascript :: js scroll page horizontally with mouse wheel 
Javascript :: add value to the top of an array in js 
Javascript :: javascript persistent storage 
Javascript :: javascript remove period from end of string 
Javascript :: como saber si un checkbox esta seleccionado en jquery 
Javascript :: js format urcurency 
Javascript :: redirect to url in javascript 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =