Get outerText value for a tag (Firefox does not support the outerText.) : outerText : DOM Node JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » DOM Node » outerText »

 

Get outerText value for a tag (Firefox does not support the outerText.)

















<html>
<head>
<title>OuterText Example</title>
<script type="text/javascript">
    function useOuterText() {
        var oDiv = document.getElementById("div1");
        alert(oDiv.outerText);
        oDiv.outerText = "new value";
        alert(document.getElementById("div1"));
    }
</script>

</head>
<body>
<div id="div1" >This is my original text</div>
<input type="button" value="Use OuterText" onclick="useOuterText()" />
</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo DOM Node
» outerText