I am trying to create a pop up search bar using html, CSS and java script. but I end up getting an error on my console
<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 java script
let search Form = document . query Selector('.search-form');
document. query Selector('#search-b t n').on click = () =>{ search-Form. class List. toggle('active');
}
the error says, Uncaught TypeError: Cannot set properties of null (setting 'onclick') at script.js:5
Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW
Comments
Post a Comment