I am stuck, Build a Wikipedia Viewer with form

$("#search").on("click", function() {

        var html = '<form><input type="text" id="target"></form>';

#search is the search button(icon) that once is clicked it appears a form
#search_bar is a div that contains the button

How do I get the data that is submitted in the form?
Wikipedia Viewer codepen.io

I tried looking it up on Google but I didn’t get the response I wanted
Also, I don’t understand how to set it to trigger after the form is submitted.

Maybe it would be better to change the css instead (display)? Without creating the form on the spot?

When you hit the search btn you need to read the input value(read how here), then with that value compose an url and call the wikipedia api.

1 Like