<div>click <span>hrer</span> to show the result of text().</div> <div>The result is a string that contains the combined text contents of <strong>all</strong> matched elements. </div> <p>Hrer is a paragraph.</p> <div>This method works on both <strong>HTML</strong> and <b>XML</b> documents.<div>Even if it is XHTML as well</div></div>
$(document.body).click(function(){ alert($("div").text()); });