Comment exécuter JS avant de soumettre HTML

<form onsubmit="return do_something()">

function do_something(){
   // Do your stuff here
   return true; // submit the form

   return false; // don't submit the form
}
Embarrassed Elephant