title: Call multiple Javascript functions from JSP in Spring
body: <p>I am developing a <code>Maven Spring</code> project in which I want to call multiple <code>javascript</code> functions from <code>JSP</code>. I am able to call all the functions without any issues but I would like to call them on different <code>div</code>. </p>
  
  <p>Here is the code of <code>JSP</code>:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  var submit = '${submitVal}';  //Variables from controller
  var accept = '${acceptVal}';
  var reject = '${rejectVal}';
  
  document.body.onload = function()
  {
      drawBarChart(submit);
      drawBarChart(accept);
      drawBarChart(reject);
  }
  &lt;/script&gt; 
  
  &lt;h1&gt;Submit Chart&lt;/h1&gt;
  &lt;div id='submit'&gt;&lt;/div&gt;
  
  &lt;h1&gt;Accept Chart &lt;/h1&gt;
  &lt;div id='accept'&gt;&lt;/div&gt;
  
  &lt;h1&gt;Reject Chart&lt;/h1&gt;
  &lt;div id='reject'&gt;&lt;/div&gt;
  </code></pre>
  
  <p><code>drawBarChart</code> is the name of my JS function and it displays bar chart. Right now it displays all the headings one below other first and then all 3 diagrams. I would like them to be displayed in the <code>div</code> so that the diagrams appears below respective headings.</p>