When you click a li
in list dbsearch it will replace the text with strSearch
$("#List").on("click", "li", function() {
$("#strSearch").val($(this).text());
});
If you want to replace the text of the nested a
link use $("a", this).text(...)
.
Also a note, generally you shouldn't capitalize ids/classes in html
Update: here's a demo fiddle