<form action="" class="search-form">
<input type="search" id="search-box" placeholder="search here...">
<label for="search-box" class="fa fa-search" aria-hidden="true"></label>
</form>
My javascript code:
const form = document.querySelector('.search-form');
document.querySelector('#search-b t n').onclick = () => {
form.classList.toggle('active');
}
An error message occurred:
Uncaught TypeError: Cannot set properties of null (setting 'onclick')
at script.js:5