Вы можете сделать
var txt = getKeyValue('empDesignation');
$('#result').text(txt);
Это предполагает, что getKeyValue() возвращает строку. Затем вы ставите этот результат как текст элемента с id = result
EDIT - после редактирования. вы могли бы сделать
HTML
<a href="#" data-key='empDesignation' class='functional'>your text</a>
JS
//when you click on a link that has the class functional
$('a.functional').on('click', function(e){
//prevent the default action
e.preventDefault();
//retrieve the data that from the html5 data attribute and pass it to
//your custom function
var result = getKeyValue($(this).data('key'));
//use the resulting string as the new text for the clicked link
$(this).text(result);
})
не может использовать что-то вроде документа .записывать? – Sam
Привет, Сэм, Могу ли я проверить последнее обновление моего обновления? –