i have used preventDefault() but thats not working here is My Code
btnBookNameSearch.addEventListener("click", (e) => {
e.preventDefault();
const searchValue = btnBookNameSearch.value.toLowerCase().trim();
allPgBooks.forEach((product) => {
if (product.name == searchValue) {
allPgBooksE2.innerHTML = '';
if (allPgBooksE2) {
there is a mistake i am doing in the first two line of code above but idk how to fix ....the Error i am getting is ....Cannot read properties of null (reading 'addEventListener') ...
`...
– Keith Dec 08 '21 at 17:06