<script>
$(document).ready(function(){
$("#btn-txt").click(function(){
var ptext = $("#my-para").text();
alert(ptext);
});
});
</script>
<button type="button" id="btn-txt">Get Text Content</button>
<p id="my-para">This is a paragraph to Show jQuery text method.</p>