'innerText' Example : innerText « Javascript Properties « JavaScript Reference

'innerText' Example

    
<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>

    
      
      








Related examples in the same category

1.'innerText' Syntax and Note
2.'innerText' is applied to