You can do it like this:
<input type="text" />
<button>Hola</button>
<button>Hello</button>
<button>Bonjour</button>
$("button").on("click", function(){
$("input").val($(this).text());
});
Within your click handler, $(this)
will refer to the element which was clicked to trigger the event, so you can just grab it's text or value or store some arbitrary text on it as a data attribute.