There are three items with IDs ('#comment-reply-box', '#comment- item-'+itemId and '#parent_id' ) in document.
I need to create a div dynamically, and add #comment-reply-box into this div and then I need to append this new div into '#comment- item-'+itemId Optionally, this new div can be slidedown when this function is triggered... This is what I try to do... On Apr 10, 12:09 am, Kenneth <[EMAIL PROTECTED]> wrote: > I am not sure I understand fully, but maybe this will help? > > function showReplyBox(itemId,parentId) > { > var box = $('#comment-reply-box'); > var itemBox = $('#comment-item-'+itemId); > var parent_id = $('#parent_id'); > > parent_id.val(parentId ? parentId : itemId); > > $("#box").hide() > > $('#replybox').remove().empty().append(box).append(itemBox).appendTo( > document.body) > } > > note: in your original code, you never re-added the #replybox to the DOM.