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 jsfiddle.net/t2jhsody only I can not get replacement value when clicking
June 3rd 19 at 19:02
1 answer
June 3rd 19 at 19:04
Solution
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 - jsfiddle.net/Svupol/t2jhsody/28
Thanks for the help! - nikita.Stracke commented on June 3rd 19 at 19:07

Find more questions by tags JavaScript