title: How can I set the form action through JavaScript?
body: <p>I have an HTML form whose action should be set dynamically through JavaScript. How do I do it?</p>
  <p>Here is what I am trying to achieve:</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot;&gt;
      function get_action() { // Inside script tags
          return form_action;
      }
  &lt;/script&gt;
  
  &lt;form action=get_action()&gt;
      ...
  &lt;/form&gt;
  </code></pre>