title: How to call a function from index.html to app.js file in node js application javascript
body: <p>I had a node js application where I have my app.js and one html which gets displayed for the route /index.Now In my index file I had a button and text box and when I click button Iam trying to call a function.Where in that function I will have a variable with some text "Hello" which should be displayed in text box.I couldnt achieve this can some one help.</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;div class="jumbotron"  style="padding:40px;"&gt;
  &lt;h1&gt;Hello!!!&lt;/h1&gt;
  &lt;div&gt;
  &lt;button type="submit" onclick="getData();"&gt;Call&lt;/button&gt;
  &lt;input type="text"&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code>app.get('/index',function(req,res){ 
  res.sendFile(path.join(__dirname+'/index.html'));
  });
  function getData(){
  console.log("Hello");
  var text="Hello";
  };
  </code></pre>
  
  <p>Right now Im getting reference error that getData is not defined.Can someone help over here.</p>