Answers for "$("#id").submit in vanilla"

1

$("#id").submit in vanilla

var yourElement = document.getElementById("yourElementID");

yourElement.addEventListener("submit", function(e) {
  
  if(something)
  	e.preventDefault(); // // stop form submission
  
  // add your code HERE
});
Posted by: Guest on June-24-2021

Code answers related to "$("#id").submit in vanilla"

Code answers related to "Javascript"

Browse Popular Code Answers by Language