title: TypeError: document.getElementById(...).submit is not a function
body: <p>I'm having an error that I can't find the solution and I don't have to use jQuery; I don't have any div with submit as name</p>
  
  <p>My code is </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;    
  &lt;html&gt;    
  &lt;head&gt;    
  &lt;script&gt;    
  function formSubmit()    
  {    
       document.getElementById('web').submit();    
  }    
  &lt;/script&gt;    
  &lt;/head&gt;    
  &lt;body&gt;    
  &lt;form action="class003.php" id="g_form" method="POST"&gt;    
  &lt;input type="text" name="f1" value=""&gt;    
  &lt;/form&gt;    
  &lt;div id="web" onclick="formSubmit()"&gt;click&lt;/div&gt;    
  &lt;/body&gt;    
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>on chrom I'm getting this error</p>
  
  <blockquote>
    <p>Uncaught TypeError: document.querySelector(...).submit is not a
    function
        at formSubmit (test2.html:8)
        at HTMLDivElement.onclick (test2.html:19)</p>
  </blockquote>
  
  <p>on Firefox the same error</p>
  
  <blockquote>
    <p>TypeError: document.getElementById(...).submit is not a function[Learn
    More]</p>
  </blockquote>