I am tring to create the update status box like facebook using Javascript/jQuery. When i click on post button the div element is created but the button that i have appended inside it is appearing only once.
This is my script code:
var hello = function() {
    var post = $.trim($("#status_message").val());
    if (post.length != 0) {
        $('<div id="hi">').text(post).prependTo('.posts');
        $("#status_message").val(" ");
        $("#hi").append($("#delete"));
        $("#hi").append($("#comment"));    
    }
}
html code:
<input type="button" id="post" name="submit" value="Post" class="btn btn-primary" onclick="hello()">  
<div class="counter"></div>  
 
     
    