title: calling id from applet object throws js error in IE
body: <p>When calling an applet id from JS giving <code>Object doesn't support this property or method</code> error.</p>
  
  <p>Please check the code...</p>
  
  <pre><code>&lt;!--[if !IE]&gt; Firefox and others will use outer object --&gt;
      &lt;object
          classid     = "java:com.mypack.myclass.ABCClass.class"
          type        = "application/x-java-applet"
          height      = "200"
          width       = "480"
          id          = "myappletId"&gt;
          &lt;!-- Konqueror browser needs the following param --&gt;
          &lt;param name="cache_archive" value="a.jar, b.jar, c.jar" /&gt;
          &lt;param name="codebase" value="applets/" /&gt;
          &lt;param name="OnMouseLeftClickJS" value="showModal()"&gt;
          &lt;!--&lt;![endif]--&gt;
          &lt;!-- MSIE (Microsoft Internet Explorer) will use inner object --&gt;
          &lt;object 
              classid     = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
              codebase    = "http://java.sun.com/update/1.5.0/jinstall-1_5_0-windows-i586.cab"
              height      = "200"
              width       = "480"
              id          = "myappletId"&gt;
              &lt;param name="code" value="com.mypack.myclass.ABCClass" /&gt;
              &lt;param name="cache_archive" value="a.jar, b.jar, c.jar" /&gt;
              &lt;param name="OnMouseLeftClickJS" value="showModal()"&gt;
              &lt;param name="codebase" value="applets/" /&gt;
              &lt;strong&gt;No Java Support&lt;/strong&gt;
          &lt;/object&gt;
          &lt;!--[if !IE]&gt; close outer object --&gt;
      &lt;/object&gt;
  &lt;!--&lt;![endif]--&gt;
  </code></pre>
  
  <p>Now, in my showModal() js function I have,</p>
  
  <pre><code>var myId = document.getElementById("myappletId"); //At this point I am getting the object data.
  </code></pre>
  
  <p>I perform some operations in my modal window which is a jquery modal window and I have a button in it. When I click on that I am calling a function say xyz().</p>
  
  <pre><code>function xyz() {
      var myId = document.getElementById("myappletId"); 
      //At this point myId is getting empty.
  }
  </code></pre>
  
  <p>This is happening in only IE Browser. I tested in IE8.
  Works good in Firefox and chrome.</p>
  
  <p>I am not navigating my page and on view source I can see my object tag.</p>
  
  <p>Please help me out. </p>
  
  <p>Thanks in advance...</p>