javascript change input value by link title
问题 I'm new to JavaScript and I need some help with a simple problem I'm having: I have one empty input field, and two links ( anchors ) with differing values for the title attribute. I'd like to write a small piece of JavaScript that changes the value of the input element to the title of whichever link the user clicks. For example: First link = Prague Second link = Budapest When I click "Budapest" I'd like the value of the input element to change to "Budapest" If needed I can supply a basic