bug in FireFox?

Look at the following code.

<html>
<head><title>Bug in Mozilla?</title></head>

<script type="text/javascript">
 function AlertAll(tagname)
 {
 var arr=document.getElementsByTagName(tagname);

 for(i=0;i<arr.length;i )
 {

 code=arr[i].innerHTML;
 alert(code);
 }

 }
</script>
<body>
<pre id="python">

 print   "Hello";


</pre>

<pre id="php">
<?php
 printf("Hello");
?>

</pre>
<script type="text/javascript">
 AlertAll("pre");
</script>
</body>

</html>

It fails in mozilla, but works in IE. Looks like innerHTML when you have text pattern like <? it fails.

click here for the live version.

The second messagebox will be empty in FireFox. It works good in IE 6 and 7

By: gavi on: