jQ - html() vs text()

This is just a live view of - http://stackoverflow.com/questions/1910794/jquery-text-vs-html accepted answer.

by hossain

HTML

<div id="div1"></div>
<div id="div2"></div>

JavaScript

$("#div1").html('<a href="example.html">Link</a><b>hello</b>');
 $("#div2").text('<a href="example.html">Link</a><b>hello</b>');