title: Firebase Anonymous Login on Form Submit Issue
body: <p>I'm trying to make it so that when I user clicks the submit button on my sign in form, they will be signed in as an anonymous user in Firebase. I know my submit button is triggering the jQuery submit event because the alert in it is being displayed. However, even though the submit button triggers the jQuery submit event, the <code>signInAnonymously</code> method is not being called for some reason. I've also tried using a putting the <code>signInAnonymously</code> call in a separate function and using the form <code>onsubmit</code> attribute but that did not work either. Here is my code (I've omitted my config details for security purposes):</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
      &lt;head&gt;
          &lt;!-- Required meta tags always come first --&gt;
          &lt;meta charset="utf-8"&gt;
          &lt;meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"&gt;
          &lt;meta http-equiv="x-ua-compatible" content="ie=edge"&gt;
  
          &lt;title&gt;Escape Room&lt;/title&gt;
  
          &lt;!-- Bootstrap CSS --&gt;
          &lt;link rel="stylesheet" href="resources/bootstrap/css/bootstrap.min.css"&gt;
  
          &lt;!-- Custom CSS --&gt;
          &lt;link rel="stylesheet" href="styles.css"&gt;
  
          &lt;!-- jQuery --&gt;
          &lt;script src="resources/jquery/jquery-3.1.1.slim.min.js"&gt;&lt;/script&gt;
  
          &lt;!-- Firebase --&gt;
          &lt;script src="https://www.gstatic.com/firebasejs/3.6.2/firebase-app.js"&gt;&lt;/script&gt;
          &lt;script src="https://www.gstatic.com/firebasejs/3.6.2/firebase-auth.js"&gt;&lt;/script&gt;
          &lt;script src="https://www.gstatic.com/firebasejs/3.6.2/firebase-database.js"&gt;&lt;/script&gt;
          &lt;script src="https://www.gstatic.com/firebasejs/3.6.2/firebase-messaging.js"&gt;&lt;/script&gt;
  
  
          &lt;script&gt;
              // Initialize Firebase
              var config = {
                  apiKey: "",
                  authDomain: "",
                  databaseURL: "",
                  storageBucket: "",
                  messagingSenderId: ""
              };
              firebase.initializeApp(config);
  
              //Initialize authentication
              var auth = firebase.auth();
  
              // Handle authenticated users
              auth.onAuthStateChanged(function(user) {
                  if (user) {
                      // User is signed in.
                      var isAnonymous = user.isAnonymous;
                      var uid = user.uid;
                      // ...
                  } else {
                      // User is signed out.
                      // ...
                  }
                  // ...
              });
  
              // When the DOM has loaded
              $(document).ready(function(e) {
  
                  $('#signIn').submit(function(e) {
                      // Prevent the page from refreshing
                      e.preventDefault();
  
                      alert("test");
  
                      // Authenticate user
                      auth.signInAnonymously().catch(function(error) {
                          alert('test2');
                          // Handle Errors here.
                          var errorCode = error.code;
                          var errorMessage = error.message;
  
                          console.error(error);
                      });
                  });
              });
  
          &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div class="container-fluid"&gt;
              &lt;div class="row"&gt;
                  &lt;div class="col-12"&gt;
                      &lt;form id="signIn"&gt;
                          &lt;div class="form-group"&gt;
                              &lt;label for="name"&gt;Name&lt;/label&gt;
                              &lt;input type="text" class="form-control" placeholder="Your Name"&gt;
                          &lt;/div&gt;
  
                          &lt;div class="form-group"&gt;
                              &lt;label for="vest"&gt;Vest Number&lt;/label&gt;
                              &lt;input type="text" class="form-control" placeholder="Vest Number"&gt;
                          &lt;/div&gt;
  
                          &lt;button type="submit" class="btn btn-primary"&gt;Start&lt;/button&gt;
                      &lt;/form&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
  
  
          &lt;!-- jQuery first, then Tether, then Bootstrap JS. --&gt;
          &lt;script src="resources/jquery/jquery-3.1.1.slim.min.js"&gt;&lt;/script&gt;
          &lt;script src="resources/tether/js/tether.min.js"&gt;&lt;/script&gt;
          &lt;script src="resources/bootstrap/js/bootstrap.min.js"&gt;&lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I'm relatively new to Firebase and this has got me baffled, so any help would be greatly appreciated!</p>