获取form表单元素的值
var formData = new FormData(document.getElementById("addForm"));
打印 formData信息
for (var [a, b] of formData.entries()) {
console.log(a, b);
}
打印结果:
a对应的是form表单元素的name,b对应form表单元素的value
获取form表单元素的值
var formData = new FormData(document.getElementById("addForm"));
打印 formData信息
for (var [a, b] of formData.entries()) {
console.log(a, b);
}
打印结果:
a对应的是form表单元素的name,b对应form表单元素的value