title: JQuery - $(document).getElementById('id').submit(function{}); unedifined not a function
body: <p>I've been searching or a solution to my problem, but none of the aswers I find are useful.</p>
  
  <p>I try to make an automatic form that submits itself when the page loads.</p>
  
  <pre><code>$(document).getElementById('ticketCount').submit(function(){
      $.ajax({
          method:$(this).attr('method'),
          url:$(this).attr('action'),
          data:$(this).serialize()
      })
      .done(function(data){
          $('#ticketCount').html(data);
      })
      .error(function(data){
          console.log(data);
      });
    });
  </code></pre>
  
  <p>My console tells me that: "Uncaught TypeError: undefined is not a function".
  I don't think I made a mistake (I know this is case-sensitive), and I already used $(document).ready(), $(document).keyup(function{}) somewhere else in the same .js file, so I don't think the problem comes from $(document)..</p>
  
  <p>I can't ind where my mistake is...</p>
  
  <p>Thanks for your answers!</p>