How to fill in the value when you click?

Good time of day.
Please tell me how to do it. I have input type="hidden" and have a list with cities. Like when you click on a city to get its value and set value of input tag? An example of what I'm trying to do only I can not get replacement value when clicking
June 3rd 19 at 19:02
1 answer
June 3rd 19 at 19:04
You can't access the script from the html if it is not in the tag script. It in the first place. Secondly, to change the value, you have to write element.value, not innerHTML.

Working example -
Thanks for the help! - nikita.Stracke commented on June 3rd 19 at 19:07

Find more questions by tags JavaScript