topical media & game development
professional-javascript-10-InnerTextExample2.htm / htm
<html>
<head>
<title>InnerText Example</title>
<style type="text/css">
div.special {
background-color: red;
padding: 10px;
}
</style>
<script type="text/javascript">
function useInnerText() {
var oDiv = document.getElementById("div1");
oDiv.innerText = oDiv.innerText;
}
</script>
</head>
<body>
<div id="div1" class="special"><b>Hello</b> world</div>
<input type="button" value="Use InnerText" onclick="useInnerText()" />
<p><strong>Note: </strong> Firefox does not support the <code>innerText</code> property so this example will fail.</p>
</body>
</html>
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.