professional-javascript-10-InnerTextExample.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 = "<b>Hello</b> world"; } </script> </head> <body> <div id="div1" class="special">This is my original text</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.