Why parent element is undefined in Firefox only when onerror event of IMG tag is called?
<p>I am trying to unhide a DIV element if my extension in Firefox is not installed. </p>

<p>For this purpose i am using the following technique.</p>

<p>This doesn't work in Firefox. it says</p>

<p><strong>ExtensionNeeded is undefined.</strong> </p>

<p>I get the alert though. Please have a look at my code.</p>

<pre><code>&lt;div style="display: none;" class="alert alert-error" id="ExtensionNeeded"&gt;
                    &lt;img style="visibility: hidden;
                        font-family: arial;" onerror="this.src='';alert('hello'); ExtensionNeeded.setAttribute('style','display:none;');" id="ffExt" src=""&gt;
                    &lt;a onclick="ExtensionNeeded.setAttribute('style','display:none;');" data-dismiss="alert" class="close" id="CloseButton"&gt;×&lt;/a&gt;
                    &lt;h4 class="alert-heading"&gt;
                        Browser Extension Needed&lt;/h4&gt;
                    &lt;p&gt;
                        SmartSignin needs browser extensions to work. Download the extensions by clicking
                        on the button below
                    &lt;/p&gt;
                    &lt;p&gt;
                        &lt;a onclick="window.location=('../Installer_files/release.xpi');ExtensionNeeded.setAttribute('style','display:none;');" class="btn btn-danger" id="ExtensionDownload" href="#"&gt;Download Extension!&lt;/a&gt;
                        &lt;a onclick="ExtensionNeeded.setAttribute('style','display:none;');" class="btn" id="DownloadLater" href="#"&gt;Download Later&lt;/a&gt;
                    &lt;/p&gt;
                &lt;/div&gt;
</code></pre>

<p>Please help. I am picking my hair out on this.</p>
