preventDefault() Not Working With Ajax : the eventDefault isn't working and I have no clue why!

I checked other forums and this should be working

I also tried $(document).ready(function() ) but that didn't work either.

The java and html are in that exact order if it makes a difference.

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

    <script type="text/javascript">
  
  	$("#my_form").submit(function(event){
     event.preventDefault(); //prevent default action 
     var post_url = $(this).attr("action"); //get form action url
     var request_method = $(this).attr("method"); //get form GET/POST method
     var form_data = $(this).serialize(); //Encode form elements for submission
     
     $.ajax({
         url : post_url,
         type: request_method,
         data : form_data
     }).done(function(response){ //
         $("#server-results").html(response);
     });
      
    


    });
</script>

<body>
  
  	<form id="my_form" method="post" action="http://link.php">
      	<input type="text" id="fullname" name="fname">
      	<input type="submit" id="submit_post" value="Post" >
    </form>
  
  	<div id="server-results"></div>
  
</body>

thanks