I had made one div tag and stored its contents in a variable. If this tag contains p,b or any other tags then it should be removed from string. How
div
p,b
This is safer:
function plaintext(html){ return $("").html(html).text(); }