title: How to get return value from javascript to html?
body: <p>How can I return a value from java script to HTML?</p>
  
  <p>Assume this is my JS file named first.js</p>
  
  <pre><code>function getName()
  {
  var Str= "Vinod";
  return Str;
  }
  </code></pre>
  
  <p>Now I need to get the value in HTML page. I have included the js file and called the function but I didn't get any value. How can I do the same.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Quick example&lt;/title&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;script type="text/javascript" src="first.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="static/jquery.js"&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" href="static/jquery.mobile-1.4.2.css" /&gt;
  script type="text/javascript" src="static/jquery.mobile-1.4.2.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  $(document).ready(function() {
  document.getElementById("privacy_text").innerHTML  = getName();
   });
  &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;textarea id="privacy_text" class="terms"&gt;
  &lt;/textarea&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>