1

So I've just come across this answer: Resetting a multi-stage form with jQuery But this doesn't mention how to reset the email input type?

I've tried currentForm.find(':input:email').val('');, but this isn't recognised as a selector. What's the correct way to reset all inputs of type email on a form?

I'm using a html element of type email:

<input placeholder="Email" type="email" name="email" required>

So this must be possible without having to reset it explicitly.

Community
  • 1
  • 1

1 Answers1

2

type is an attribute, so you should use an attribute selector:

$(":input[type=email]", currentForm).val("");
Barmar
  • 741,623
  • 53
  • 500
  • 612