$("a").click(function (e) { e.preventDefault(); var elem = $("input"); var text = $(this).text(); elem.val( elem.val() + " " + text ); });