title: Using deployJava.runApplet to target specific element
body: <p>After many years of successfully maintaining an applet that uses the good old: </p>
  
  <pre><code>&lt;script src="foo.js"&gt;&lt;/script&gt; 
  </code></pre>
  
  <p>method of embedding a Java applet, we're unable to cover our ears and sing "La la la!" anymore. </p>
  
  <p>It's time to be using:</p>
  
  <pre><code>deployJava.runApplet()
  </code></pre>
  
  <p>When I fire this method using a click handler (here using an event listener on a button via jQuery, but it doesn't matter):</p>
  
  <pre><code>$('#button').click(function() {
    deployJava.runApplet(attributes, parameters, version);
  });
  </code></pre>
  
  <p>...it wipes out the entire existing document and replaces it with the applet. All I need to know is how to target a specific DOM element to be the container for the applet, so that my page doesn't get wiped. </p>
  
  <p>It seems like it would be an attribute I could pass in the form of <code>target: someElement</code> where "someElement" is either a DOM object or the element's ID as a string. But alas, I can't find documentation for such an attribute.</p>
  
  <p>For the sake of being complete, here's what's being passed:</p>
  
  <pre><code>/*here is where I imagine there might be an applicable attribute */
  var attributes = {
    name: "SomeName",
    code: "some.class",
    archive: "some.jar",
    width: 640,
    height: 400
  };
  
  var parameters = {
    someParameter: someValue
  };
  
  var version = "1.5";
  </code></pre>
  
  <p>I can <code>document.write</code> everything I need to rebuild a document, but I'm sure you can all well imagine how hideous that prospect seems to me.</p>
  
  <p>Any pointers would be greatly appreciated.</p>