Horje
addclass js vanilla Code Example
addclass js vanilla
  element.classList.add('className');
vanilla javascript add class
document.addEventListener("DOMContentLoaded", function() {
  var faqContainers = document.getElementsByClassName('faq-container')
  var faqToggle = document.getElementsByTagName('body')[0]
  for (var i = 0; i < faqContainers.length; i++) {

    faqContainers[i].addEventListener('click', function() {
      if (faqToggle.classList.contains('faq-display')) {
        faqToggle.classList.remove('faq-display')
      } else {
        faqToggle.classList.add('faq-display')
      }
    })
  }
})




Javascript

Related
set port nextjs Code Example set port nextjs Code Example
emmet not working in react nextjs Code Example emmet not working in react nextjs Code Example
get array of all property in object array Code Example get array of all property in object array Code Example
emmet not working  next.js vs code Code Example emmet not working next.js vs code Code Example
javascript does key exist Code Example javascript does key exist Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7