I think you are looking for this
http://jsfiddle.net/apw8xsmk/[
^]
$(document).ready(function(){
$('#searchbtn').click(function(){
var txt = $.trim($('#msgtxt').val());
var box = $("#msgtxttt").html();
if(box!=""){
$("#msgtxttt").html(txt +"<br />" +box);
}
else
$("#msgtxttt").html(txt);
$('#msgtxt').val("");
})
});
If not? Reply... :)