Javascript not working on firefox
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1359469/innertext-works-in-ie-but-not-in-firefox">&#39;innerText&#39; works in IE, but not in Firefox</a>  </p>
</blockquote>



<p>Why the following script work on IE and safari but not in Firefox?</p>

<pre><code>&lt;html&gt;

&lt;head&gt;&lt;script type="text/javascript"&gt;

function ShowHide(strTag ,strAttribute){

var elem = document.getElementsByTagName(strTag); 
var elem1 = evt.srcElement || evt.target; 

for (var i=0;i&lt;elem1.children.length;i++){ 
    elem1.children[i].innerText=="4" ? elem1.children

[i].innerText="6":elem1.children[i].innerText="4"; 
} 
    for (var i =0;i&lt;elem.length;i++) { 
        if(elem[i].getAttribute(strAttribute)=="yes") { 
         elem[i].style.display=='none'? elem[i].style.display='block':elem

[i].style.display='none'; 
         } 
     } 
} 

&lt;/script&gt;


&lt;div id=div1 onclick="ShowHide('div','exp2');"&gt;
&lt;font face=Webdings color=BLACK&gt;4&lt;/font&gt; click here for some expandable 

divs...&lt;/div&gt; 
&lt;div id=div2 exp2='yes' style="display:none;"&gt;I'm a div!&lt;/div&gt; 
&lt;div id=div3 exp2='yes' style="display:none;"&gt;More of them divs...&lt;/div&gt; 
&lt;div id=div4 exp2='yes' style="display:none;"&gt;Me too! divs...&lt;/div&gt; 

&lt;/body&gt;
&lt;/html&gt;
</code></pre>
