Created
September 20, 2016 01:49
-
-
Save parkerproject/fb8ac923c1a811d5ff59e1bd216f8a8d to your computer and use it in GitHub Desktop.
This file contains hidden or 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 form, | |
| docfrag, | |
| formId, | |
| inputString1, | |
| inputString2, | |
| inputNameString1, | |
| inputNameString2; | |
| docfrag = document.createDocumentFragment(); | |
| form = document.createElement("form"); | |
| formId = document.createAttribute("id"); | |
| formId.value = 'str-form'; | |
| form.setAttributeNode(formId); | |
| inputString1 = document.createElement("input"); | |
| inputNameString1 = document.createAttribute("name"); | |
| inputNameString1.value = 'str1'; | |
| inputString1.setAttributeNode(inputNameString1); | |
| inputString2 = document.createElement("input"); | |
| inputNameString2 = document.createAttribute("name"); | |
| inputNameString2.value = 'str2'; | |
| inputString2.setAttributeNode(inputNameString2); | |
| form.appendChild(inputString1); | |
| form.appendChild(inputString2); | |
| docfrag.appendChild(form); | |
| document.getElementsByTagName('body')[0].appendChild(docfrag); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment