Home > front end >  Questions about the FormData a weak
Questions about the FormData a weak

Time:01-15


<script>
Var form=document. GetElementById (' form ')
Var BTN=document. GetElementById (' BTN)
Var formdata=https://bbs.csdn.net/topics/new formdata (form)
BTN. Onclick=function () {
Var formdata2=new FormData (form)
The console. The log (formdata. Get (" username "))
The console. The log (formdata2. Get (" username "))
}
</script>

Var formdata=https://bbs.csdn.net/topics/new formdata this line (form), defined in the BTN. Outside the onclick why not?
Var formdata2=new FormData (form) is written in the BTN. Within the onclick,

Begged god give directions, thank you

CodePudding user response:

Not not, is no content, writing on the outside, when the page rendering has gained the value, but there is no any content, rendering is empty, when click the submit button, typing the content is early to get good empty content, only when click to get to read the contents of the input box,
  • Related