Assign value to the innerText node : innerText « DOM Node « JavaScript Tutorial






Firefox does not support the innerText property.

<html>
    <head>
        <title>InnerText Example</title>
        <script type="text/javascript">
            function useInnerText() {
                var oDiv = document.getElementById("div1");
                oDiv.innerText = oDiv.innerText;
            }
        </script>
 
    </head>
    <body>
        <div id="div1"><b>Hello</b> world</div>
        <input type="button" value="Use InnerText" onclick="useInnerText()" />

    </body>
</html>








23.12.innerText
23.12.1.Assign value to the innerText node
23.12.2.Change the innerText