Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

bootstrap hide navbar

const navLinks = document.querySelectorAll('.nav-item')
const menuToggle = document.getElementById('navbarSupportedContent')
const bsCollapse = new bootstrap.Collapse(menuToggle)
navLinks.forEach((l) => {
    l.addEventListener('click', () => { bsCollapse.toggle() })
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #bootstrap #hide #navbar
ADD COMMENT
Topic
Name
4+2 =