Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

query selector has clas

if (document.body.classList.contains('thatClass')) {
    // do some stuff
}
Comment

query selector has clas

document.body.classList.add('thisClass');
// $('body').addClass('thisClass');

document.body.classList.remove('thatClass');
// $('body').removeClass('thatClass');

document.body.classList.toggle('anotherClass');
// $('body').toggleClass('anotherClass');
Comment

PREVIOUS NEXT
Code Example
Javascript :: Finding HTML Element by Id 
Javascript :: toggle in react 
Javascript :: jquery get mouse page left and top 
Javascript :: javascript remove character from string 
Javascript :: jquery json object 
Javascript :: javascript date get nearest 5 minutes 
Javascript :: react native get mac address 
Javascript :: add zero in front of numbers javascript 
Javascript :: javascript colorized console.log 
Javascript :: javascript delay 
Javascript :: javascript check if object property exists 
Javascript :: fs.writefilesync in nodejs 
Javascript :: js shortcut 
Javascript :: javascript change dataset value 
Javascript :: how to loop through array of numbers in javascript 
Javascript :: change checkbox jquery alert 
Javascript :: filter biggest value javascript object 
Javascript :: javascript find string between two characters 
Javascript :: discord.js listen for message 
Javascript :: ng class in angular 
Javascript :: jquery value of input 
Javascript :: reactnative get height screen 
Javascript :: delay statement in js 
Javascript :: insert image in react 
Javascript :: add image in react native 
Javascript :: on hover add class on children jquery 
Javascript :: insert into specific array index 
Javascript :: node js throw error 
Javascript :: reset redux form after validation 
Javascript :: javascript add to array 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =