title: How to pass values from HTML page to java applet?
body: <p>I have tried passing values using javascript like below</p>
  
  <pre><code>&lt;script language= "javascript" type= "text/javascript"&gt;
  var num;
  function getVal()
  {
  num=document.getElementById('in').value;
  alert(document.getElementById('parm').value);
  }
  &lt;/script&gt;
  &lt;body&gt;
  &lt;form &gt;
  Number : &lt;input type="text" id="in"  &gt;&lt;br/&gt;
  &lt;button id="myBtn" onclick="getVal()"&gt;Try it&lt;/button&gt;&lt;br/&gt;  
  &lt;/form&gt;
  &lt;APPLET code="Calc.class" width="100" height="100"&gt;
  &lt;PARAM name="number" id="parm"&gt;
  &lt;/APPLET&gt;
  
  &lt;/body&gt;    
  &lt;/html&gt;
  </code></pre>
  
  <p>The alert box displays the entered value on screen but the applet code is not displaying the same. My applet code is </p>
  
  <pre><code>public class Calc extends Applet
  {
  
      private String strDefault = "Hello! Java Applet.";
      public void paint(Graphics g) {
      String strParameter = this.getParameter("number");
      if (strParameter == null)
      strParameter = strDefault;
      g.drawString(strParameter, 10, 10);
      }
  }
  </code></pre>
  
  <p>Can anyone tell me the code to pass and retrieve values to and from param tag to html?</p>