jQuery simulate form submit

Sam Deering

Simple jQuery snippet to simulate a form submit.

$("#myform").submit();

or using raw JavaScript (on element):

this.form.submit();

Win an Annual Membership to Learnable,

SitePoint's Learning Platform

  • Sana Talha
  • The Real Sam

    How would you go about fully simulating the form post in a page with out a html form.
    Example: Submitting from a js bookmaklet.