Trouble with a simple GetElementById thing real simple
<p>Real simple but I'm starting with javascript so it should be quickly soved</p>

<p>I have this html:</p>

<pre><code>&lt;body&gt;
&lt;div id="content"&gt;
        &lt;div id="logo"&gt;
            &lt;noscript&gt;
            &lt;img src="fin_palais.png"/&gt;
            &lt;/noscript&gt;
        &lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
</code></pre>

<p>and i want to select the div with an id of "logo" with javascript to then overwrite the <code>&lt;noscript&gt;</code> with the apropriate file ( a simple browser test to see if you can support SVG )
this innerHTML look like this:</p>

<pre><code>document.getElementById('logo').innerHTML='&lt;content to be added&gt;';
</code></pre>

<p>Firebug send me this error: <em>TypeError: document.getElementById("logo") is null</em>
but its right there!
Thanks</p>

<p>okay so here is the full HTML:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
    &lt;META CHARSET="UTF-8"&gt;
    &lt;title&gt;Bienvenu au Fin Palais&lt;/title&gt;
    &lt;script type="text/javascript" src="svg_support.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;getSvgSupport("fin_palais")&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="content"&gt;
        &lt;div id="logo"&gt;

            &lt;noscript&gt;
            &lt;img src="fin_palais.png"/&gt;
            &lt;/noscript&gt;
        &lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>and here's the full svg_support.js I've made;</p>

<pre><code>function getSvgSupport(file)
            {

                var ua = navigator.userAgent;
        if( ua.indexOf("Android") &gt;= 0 )
            {
          var androidversion = parseFloat(ua.slice(ua.indexOf("Android")+8)); 
          if (androidversion &lt;= 2.3)
                {
                document.getElementById('logo').innerHTML='&lt;img src="',file,'.png"/&gt;';

                }


            } else {
                document.getElementById('logo').innerHTML='&lt;!--[if lt IE 9]&gt;&lt;img src="',file,'.png"/&gt;&lt;![endif]--&gt;&lt;!--[if gte IE 9]&gt;&lt;!--&gt;&lt;embed src="',file,'.svg" type="image/svg+xml" /&gt;&lt;!--&lt;![endif]--&gt;';
            }
        }
</code></pre>
