Falah Al Fitri
Posted on December 13, 2019
/* get all form and loop */
$( "form" ).each( function () {
/* addEventListener onsubmit each form */
$( this ).bind( "submit", function (event) {
/* return false */
event.preventDefault();
var form = event.target;
/* display each props of forms */
console.log( form ); // object formHTML
console.log( "form id: " + form.id );
console.log( "form action: " + form.action );
console.log( "form method: " + form.method );
} );
});
Demo repl.it
💖 💪 🙅 🚩
Falah Al Fitri
Posted on December 13, 2019
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.