<!DOCTYPE html>
<html lang="en-US">
<body>
<p>Hard work <strong>never</strong> fails.</p>
<p>Click on the button to display the whole text of first child in the p tag.</p>
<button onclick="myFunction()">Click Me</button>
<p id="point"></p>
<script>
var node = document.getElementsByTagName("p")[0];
var x = document.getElementById("point");
function myFunction(){
x.innerHTML = node.firstChild.wholeText;
}
</script> </body>
</html>