https://ifuwanna.tistory.com/196
/* Javascript */
// create element (form)
var newForm = document.createElement('form');
// set attribute (form)
newForm.name = 'newForm';
newForm.method = 'post';
newForm.action = 'https://ifuwanna.tistory.com/196';
newForm.target = '_blank';
// create element (input)
var input1 = document.createElement('input');
var input2 = document.createElement('input');
// set attribute (input)
input1.setAttribute("type", "hidden");
input1.setAttribute("name", "data1");
input1.setAttribute("value", "value1");
input2.setAttribute("type", "hidden");
input2.setAttribute("name", "data2");
input2.setAttribute("value", "value2");
// append input (to form)
newForm.appendChild(input1);
newForm.appendChild(input2);
// append form (to body)
document.body.appendChild(newForm);
// submit form
newForm.submit();
'[React] Front-End' 카테고리의 다른 글
[Javascript] 앨리의 드림코딩 총정리 (0) | 2021.04.10 |
---|---|
ASYNC와 DEFER / ECMAScript / SPA / DOM / W3C (0) | 2021.04.07 |
[JSP/Javascript] HTTP 통신 GET방식 파라미터 값 수신 (0) | 2020.06.04 |
[Vanilla Javascript] Events, Events Handler (0) | 2020.02.11 |
[노마드코더: Vanilla Javascript] Array, Object, Function (0) | 2020.02.09 |