What is the difference between click in
document.getElementById(\"myBtn\").addEventListener(\"click\", displayDate);
and onclick in
$("#profile-register #submit").click(function (e) {
e.preventDefault();
console.log("I executed")
})
successfully prevent the default the behavior,but code below can't
$("#profile-register #submit").onclick=function (e) {
e.preventDefault();
console.log("I executed")
}
it redirect the form with parameter,you can see it in the URL frame above