I have a span HTML object, I try to use getElementById and innerText to set the text between the start and end of the object. It works fine on IE, Google Chrome and Safari but it doesn’t work Firefox.
For example:
+ HTML object:
<span id="intro"></span> |
+ getElementById and innerText:
<script language="javascript"> document.getElementById("intro").innerText = "4 Rapid Development"; </script> |
The piece of JavaScript above doesn’t work on Firefox but when I try with innerHTML, it works 🙂
<script language="javascript"> document.getElementById("intro").innerHTML = "4 Rapid Development"; </script> |
Hope the simple post helps someone!