Created
November 12, 2016 20:11
-
-
Save smks/30ccb2095da360cff7e8cb1c9b0b7d8e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var formElement = document.createElement('form'); | |
formElement.setAttribute('method','post'); | |
formElement.setAttribute('action','login.php'); | |
var usernameField = document.createElement('input'); | |
usernameField.setAttribute('type','text'); | |
usernameField.setAttribute('name','username'); | |
var passwordField = document.createElement('input'); | |
passwordField.setAttribute('type','password'); | |
passwordField.setAttribute('name','password'); | |
var submitField = document.createElement('input'); | |
submitField.setAttribute('type','submit'); | |
submitField.setAttribute('value','Submit'); | |
formElement.appendChild(usernameField); | |
formElement.appendChild(passwordField); | |
formElement.appendChild(submitField); | |
document.body.insertBefore(formElement, document.body.childNodes[0]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment