insertAfter in jquery

i use insertAfter to insert a div tag in to an element.

$("<div class='redBox'>Iron man</div>").insertAfter('#footer');

<div class=‘redBox’>Iron man</div> displayed in web browse. but when view source (ctr+u) not display

That is exactly how browsers are designed to work, when you manipulate the DOM any new element introduced into the source won’t be shown as it can only see what was loaded when you initially opened the page. To view new elements you will need to use Firebug for Firefox or the Chrome developer tools which are built into Google Chrome.

but $(“<div class=‘redBox’>Iron man</div>”).insertAfter(‘#footer’); called in $(document).ready(function() { }

My above comments are the answer to your question, regardless of how you insert your new HTML into the DOM is will never show up in the view source window as it is stored in the browser memory on load and never changed regardless of what happens in the DOM.

if use live method?

Again nothing you do will result in the new HTML showing up in the view source window, its 100% impossible for it to show up there.