title: Calling a servlet from an <li> via onclick
body: <p>I've been searching around for at least an hour and I haven't found anything like this. I'm trying to call a servlet method with an onclick function on an <code>&lt;li&gt;</code> element (in my navbar).</p>
  
  <p>Basically I want the functionality of </p>
  
  <pre><code>&lt;li&gt;
      &lt;form method="POST" action="HomeBservlet"&gt;
          &lt;button type="submit" class="btn btn-default" name="profil"&gt;Profil
      &lt;/form&gt;
  &lt;/li&gt;`
  </code></pre>
  
  <p>without the button (therefore the onclick).</p>
  
  <p>This is something I found:</p>
  
  <pre><code>&lt;li onclick="navbarForm.submit();"&gt;
      &lt;a data-toggle="tab" href="#"&gt;Profil&lt;/a&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>and it calls the servlet, but not the right function in it, leaving me with a blank page.</p>
  
  <p>I can't seem to wrap my head around it, and I hope someone here knows what I'm looking for.</p>
  
  <p>All help is appreciated!</p>
  
  <p><a href="https://i.stack.imgur.com/32fNr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/32fNr.png" alt="enter image description here"></a></p>