title: Function not being called when button is clicked
body: <p>So, as the title suggested. That's the problem. Below is my code, I would be very thankful for your kind assistance. Thank you! </p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;TODO supply a title&lt;/title&gt;
          &lt;meta charset="UTF-8"&gt;
          &lt;meta name="viewport" content="width=device-width"&gt;
      &lt;/head&gt;
      &lt;body&gt;
      &lt;center&gt;&lt;form action="Login.jsp" method="post" id="Logform"&gt;
              User: &lt;input type="text" size="10" name="usr" id="user"&gt;&lt;br&gt;
              Password: &lt;input type="password" size="10" name="pwd" id="pw"&gt;&lt;br&gt;
              &lt;button type="button" onclick="mycheck()"&gt;  Login  &lt;/button&gt;
          &lt;/form&gt;
          &lt;a href="Registration.html" target="MAINIFRAME"&gt;&lt;button&gt;Register&lt;/button&gt;&lt;/a&gt;
          &lt;center&gt;&lt;a href="Advertise.jsp"&gt;&lt;img src="Back.jpg" width="200"&gt;&lt;/a&gt;&lt;/center&gt;
      &lt;/center&gt;
      &lt;script language="javascript"&gt;
          function mycheck()
          {
              var user = document.getElementById('user');
              var password = document.getElementById('pw');
              var MYform = document.getElementById('Logform');
              if (user.value == "" || user.value == null)
              {
                  alert('Please enter username!');
                  user.focus();
              }
              else if (password.value == "" || password.value == null)
              {
                  alert('Please enter password!');
                  password.focus();
  
              }
              else
              {
                  MYform.submit();
              }
          }
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  
  enter code here
  </code></pre>
  
  <p>Just some additional information:<br>
  Tried adding a semicolon after function, doesn't work.<br>
  Tried capitalizing onclick to onClick, doesn't work as well.<br></p>