<html>
<head>
<script type="text/javascript" src='http://code.jquery.com/jquery-1.5.2.js'></script>
<script type="text/javascript">
$(document).ready(function(){
console.log($("p").contents() );
console.log($("p").contents().text());
});
</script>
</head>
<body>
<p>Hello <span>span</span>data</p>
</body>
</html>