'innerText' Example : innerText « Node Operation « JavaScript DHTML






'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