Can't get value of input type=“file”?

后端 未结 8 2045
谎友^
谎友^ 2020-11-27 16:48

I have a

When I\'m using: alert($(\"#uploadPicture\").val());

It ale

8条回答
  •  攒了一身酷
    2020-11-27 17:14

    You can read it, but you can't set it. value="123" will be ignored, so it won't have a value until you click on it and pick a file.

    Even then, the value will likely be mangled with something like c:\fakepath\ to keep the details of the user's filesystem private.

提交回复
热议问题