Skip to content

Instantly share code, notes, and snippets.

@jcasabona
Created May 24, 2017 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcasabona/c39ce15c18373489801faffdb0396287 to your computer and use it in GitHub Desktop.
Save jcasabona/c39ce15c18373489801faffdb0396287 to your computer and use it in GitHub Desktop.
$(document).ready(function () {
var method;
method = method || 'POST';
var form = document.createElement("form");
form.setAttribute("method", method);
form.setAttribute("action", '/');
var hiddenField = document.createElement("input");
hiddenField.setAttribute("type", "hidden");
hiddenField.setAttribute("name", 'joe');
hiddenField.setAttribute("value", '31');
form.appendChild(hiddenField);
console.log(form);
document.body.appendChild(form);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment