title: How to Call a JS function using OnClick event
body: <p>I am trying to call my JS function that I added in the header. 
  Please find below code that shows my problem scenario. 
  Note: I don't have access to the body in my application. 
  Everytime I click on the element with <code>id="Save"</code> it only calls <code>f1()</code> but not <code>fun()</code>. How can I make it call even my <code>fun()</code>?
  Please help.</p>
  
  <pre><code>  &lt;!DOCTYPE html&gt;
    &lt;html&gt;
    &lt;head&gt;
  
    &lt;script&gt;
  
     document.getElementById("Save").onclick = function fun()
      {
       alert("hello");
       //validation code to see State field is mandatory.  
      }   
  
      function f1()
      {
         alert("f1 called");
         //form validation that recalls the page showing with supplied inputs.    
      }
  
    &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
    &lt;form name="form1" id="form1" method="post"&gt;
              State: 
              &lt;select id="state ID"&gt;
                 &lt;option&gt;&lt;/option&gt;
                 &lt;option value="ap"&gt;ap&lt;/option&gt;
                 &lt;option value="bp"&gt;bp&lt;/option&gt;
              &lt;/select&gt;
     &lt;/form&gt;
  
     &lt;table&gt;&lt;tr&gt;&lt;td id="Save" onclick="f1()"&gt;click&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
  
     &lt;/body&gt;
     &lt;/html&gt;
  </code></pre>