Change the innerText : innerText : DOM Node JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » DOM Node » innerText »

 

Change the innerText

















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 = "<b>Hello</b> world";
            }
        </script>
 
    </head>
    <body>
        <div id="div1">This is my original text</div>
        <input type="button" value="Use InnerText" onclick="useInnerText()" />
    </body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo DOM Node
» innerText