I have a form in my project and when it is submitted I need to send the data to an API and receive the response to check if there's an errors
the html
<form id="contactForm" class="w-75 mx-auto">
<input type="text" class="form-control bg-transparent" placeholder="Name">
<input type="email" class="form-control bg-transparent my-3" placeholder="E-mail">
<textarea class="form-control bg-transparent" placeholder="Your Message"></textarea>
<button type="submit" class="my-3 px-4 py-2 rounded-3">SEND</button>
</form>
the js
$('#contactForm').submit(function (e) {
e.preventDefault();
});