DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
HTML() API In Jquery
Jquery .html() api uses <a href="http://programmingbulls.com/jquery-html-vs-innerhtml">Jquery innerhtml()</a> to find html content within certain div element. Jquery html() api filters the data and do exception handling around innerhtml which is inconsistent at different browsers.
<div class="mydiv"> <span>Test</span> <div> $('.mydiv').html("Hello!");
This would give the following output:
<div class="mydiv"> Hello! <div>