You can go through this simple example.
Add the below script :
$(function(){
$(".dropdown-menu li a").click(function(){
$(".btn:first-child").text($(this).text());
$(".btn:first-child").val($(this).text());
});
});
Also you can try this sample in http://jsbin.com/owuyix/4/edit