OLD | NEW |
---|---|
(Empty) | |
1 <html> | |
2 <head> | |
3 <script> | |
4 function createDynamicForm() { | |
5 var dynamicForm = document.createElement('form'); | |
6 dynamicForm.setAttribute('name', 'dynamic_form'); | |
7 dynamicForm.setAttribute('method','post'); | |
8 dynamicForm.setAttribute('action','done.html'); | |
Ilya Sherman
2013/09/10 01:27:58
nit: Please leave a space after the comma (lines 7
guohui
2013/09/13 15:09:39
Done.
| |
9 dynamicForm.setAttribute('onsubmit', 'return true;'); | |
10 | |
11 var inputUsername = document.createElement('input'); | |
12 inputUsername.setAttribute('type','text'); | |
13 inputUsername.setAttribute('name','username'); | |
Ilya Sherman
2013/09/10 01:27:58
Ditto here and below.
guohui
2013/09/13 15:09:39
Done.
| |
14 | |
15 var inputPassword = document.createElement('input'); | |
16 inputPassword.setAttribute('type','password'); | |
17 inputPassword.setAttribute('name','password'); | |
18 | |
19 var submitButton = document.createElement('input'); | |
20 submitButton.setAttribute('type','submit'); | |
21 submitButton.setAttribute('value','Submit'); | |
22 | |
23 dynamicForm.appendChild(inputUsername); | |
24 dynamicForm.appendChild(inputPassword); | |
25 dynamicForm.appendChild(submitButton); | |
26 | |
27 document.body.appendChild(dynamicForm); | |
28 } | |
29 </script> | |
30 </head> | |
31 <body onload='createDynamicForm()'></body> | |
Garrett Casto
2013/09/10 17:13:45
We discussed this offline, but just as a reminder:
guohui
2013/09/13 15:09:39
As discussed offline, this does test the new code
| |
32 </html> | |
OLD | NEW |