50projects50days/hidden-search/script.js
2020-10-15 15:18:45 -04:00

8 lines
236 B
JavaScript

const search = document.querySelector('.search')
const btn = document.querySelector('.btn')
const input = document.querySelector('.input')
btn.addEventListener('click', () => {
search.classList.toggle('active')
input.focus()
})