If the project is really this small then it's probably easier to just attach some onclick
handlers to your anchors, and then define a very basic function to update the input element.
HTML
<a href="#" title="Prague" onclick="updateValue(this.title, event);">Prague</a>
<a href="#" title="Budapest" onclick="updateValue(this.title, event);">Budapest</a>
<input type="text" id="country" name="country" value="" />
JavaScript
function updateValue(val, event) {
document.getElementById("country").value = val;
event.preventDefault();
}
Example: http://jsfiddle.net/zUVA5/
If you have a large amount of anchors then adding individual onclick
handlers by hand would be quite a pain, to avoid this you can simply wrap your content in a containing element and then apply click
event handlers to all nested anchors programmatically:
Example: http://jsfiddle.net/FUvYC/