i use insertAfter to insert a div tag in to an element.
<div class='redBox'>Iron man</div> displayed in web browse. but when view source (ctr+u) not displayHTML Code:$("<div class='redBox'>Iron man</div>").insertAfter('#footer');
| SitePoint Sponsor |
i use insertAfter to insert a div tag in to an element.
<div class='redBox'>Iron man</div> displayed in web browse. but when view source (ctr+u) not displayHTML Code:$("<div class='redBox'>Iron man</div>").insertAfter('#footer');

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.
Blog/Portfolio | Evolution Xtreme | DFG Design | DFG Hosting | CSS-Tricks | Stack Overflow | Paul Irish
Having lame problems with your code? Let us help by using a jsFiddle
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.
Blog/Portfolio | Evolution Xtreme | DFG Design | DFG Hosting | CSS-Tricks | Stack Overflow | Paul Irish
Having lame problems with your code? Let us help by using a jsFiddle
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.
Blog/Portfolio | Evolution Xtreme | DFG Design | DFG Hosting | CSS-Tricks | Stack Overflow | Paul Irish
Having lame problems with your code? Let us help by using a jsFiddle
Bookmarks