Wikipedia Project

Here’s my codepen:

so it’s almost finished. the only problem is that I can’t figure out how to delete the articles off the page for a second search. I’m using jquery append() and it just tacks the new search on the bottom of the page. I’ve tried remove() and detach(), but either of those cause nothing to display on the page from even the first search. Is there something I can impelement here, or do I need to figure out a completely different way to display the data?

You need to clear out the div first. Insert $("#primary").empty(); after line 12. This will clear it out before you fill it with the for loop.

1 Like