Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to remove class in all siblings javascript

const setActive = el => {
    [...el.parentElement.children].forEach(sib => sib.classList.remove('active'))
    el.classList.add('active')
    }
Comment

PREVIOUS NEXT
Code Example
Javascript :: dot env react native 
Javascript :: Update multiple documents by id set. Mongoose 
Javascript :: ajax current url 
Javascript :: react select npm 
Javascript :: JavaScript String startsWith() examples 
Javascript :: convert string to unicode javascript 
Javascript :: local database with javascript 
Javascript :: regex for comments javascript 
Javascript :: convert json to dataframe 
Javascript :: round decimal js 
Javascript :: file upload in jquery 
Javascript :: change class Name in react 
Javascript :: string json to class c# 
Javascript :: string to currency javascript 
Javascript :: find highest value in array javascript 
Javascript :: delete a node in dom javascript 
Javascript :: javascript todataurl 
Javascript :: add tailwind to vue 
Javascript :: javascript get child element by parent id 
Javascript :: i18n vue cli 
Javascript :: increased the value of a counter when a button is clicked in javascript 
Javascript :: upload preview image js 
Javascript :: js check if two arrays contain same values 
Javascript :: js html tag valu 
Javascript :: fabric download 
Javascript :: axios fetch 
Javascript :: jquery change button click function 
Javascript :: jquery get dropdown list selected value 
Javascript :: bootstap jquery 
Javascript :: random code generator 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =