I am not using the form tag.
<input type="email" placeholder="Email" name="email" />
<input type="password" placeholder="Password" name="password" />
<p>Submit</p>
This is the jQuery:
$(document).on("click","p",function(){
var email = $(".inputs input[name=email]").val();
var password = $(".inputs input[name=password]").val();
$.ajax({
url:"url",
method:"POST",
data:{email:email,password:password},
success:function(data){
alert("Done");
}
});
});
Normally Chrome forces your email input to be valid, before it allow you to submit.
How can I do this with just jQuery Ajax, where no form
tag or button
is present?