I created the following script putting the html at the end of body tag.
If you are using or following web 2.0(Table less HTML) standards for creating the HTMLs then this script will work 100%
Just Put this script in your HTML and see the html source. You will able to see the div id named “kapil” with the test content.
<script type=’text/javascript’>
var kapil = document.createElement(‘div’);
kapil.id = ‘form_kapil’;
var all_divs = document.getElementsByTagName(‘div’);
if (document.body.firstChild){
document.body.insertBefore(kapil, all_divs[all_divs.length] );
} else {
document.body.appendChild(kapil);
}
var oldHTML = document.getElementById(‘form_kapil’).innerHTML;
var newHTML = “test content”;
//document.getElementById(‘form_kapil’).innerHTML = newHTML;
var all_divs = document.getElementsByTagName(“div”);
//alert(all_links[all_links.length - 1].innerHTML);
all_divs[all_divs.length - 1].innerHTML = newHTML;
</script>
Have fun!
Incoming search terms:
- append html
- append html at end of body tab by jquery
- how to generate Horizontal menu with appendTo in jquery ajax and php and mysql
- javascript append to end of body tag


