html encode div

by rwone

HTML

<div id="encode_me">
<html>test</html>
</div>

JavaScript

my_value = $("#encode_me");
$('<div/>').text(my_value).html();