[Solved]Wikipedia API Problem

I am having troubles getting json back from the wikipedia api. I am using the fetch api for the request. Can someone take a look at my code and tell me what is going on?

[Solution]
Removed onsubmit=“search()” from form and made an event listener on my search button as @camperextraordinaire stated. For the addEventListener second parameter I used an anonymous function and it handled a preventDefault so the page wouldn’t refresh.
function(e){ e.preventDefault; search(); }

Thank you. The request works but the search function is saying preventDefault is undefined. What does that mean?

[Solved] I put the search function inside an anonymous function for the second param of addEventListener.