50projects50days/hidden-search/script.js

8 lines
236 B
JavaScript
Raw Normal View History

2020-10-15 19:18:45 +00:00
const search = document.querySelector('.search')
const btn = document.querySelector('.btn')
const input = document.querySelector('.input')
btn.addEventListener('click', () => {
search.classList.toggle('active')
input.focus()
})