title: Getting the value of prompt box into another function
body: <p>Please check out the code below. I want to get the value entered in the prompt box into function dis(). How can I do that?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
  function display()
  {
  var z=prompt("enter your name...");
  if(z!=null)
  {
  document.getElementById("demo").innerHTML="thankyou"+z+"..";
  document.getElementById("case").style.display='block';
  }
  else
  document.getElementById("demo").innerHTML="thankyou";
  }
  function dis()
  {
  
      var a=document.getElementById("aaa").value;
      alert("your mark is"+a);
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;p id="demo"&gt;click on the button.....&lt;/p&gt;
  &lt;button type="button" onclick="display()"&gt;submit&lt;/button&gt;
  &lt;div id="case" style="display:none"&gt;
  &lt;input type="text" id="aaa" name="myText" onDblClick="dis()"&gt;enter your mark
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt; 
  </code></pre>