<html> <body> <p id="myP">Sample Text inside a <b>p</b> element</p> <button onclick="alert(myP.innerHTML);">InnerHTML</button> <button onclick="alert(myP.innerText);">InnerText</button> </body> </html>