Extract and adding an attribute to url endpoint - WikiPedia Viewer Help needed

I want to extract the attribute from the search box.

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