Help needed in wikipedia viewer project

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

here’s my codepen-
https://codepen.io/sai_yerni_akhil/pen/odPWg

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.