Help needed in wikipedia viewer project

Can anyone tell me what are the changes to be done in my project ?

here’s my codepen-

when you call this var searchstring = $("search-text").val(); in doc.ready the input has no value yet

where to place the var string value and where to place the extraction?

I would place it in an form submit event. Read here how to write the event.