Home >Web Front-end >JS Tutorial >How to obtain the URL of this file upload in multiple forms and implement js code_javascript skills

How to obtain the URL of this file upload in multiple forms and implement js code_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:39:37837browse

Suppose there are multiple forms in a web page, and one of the forms has file upload.

Copy the code The code is as follows:






...

...

...






The question is how to get this file What about the uploaded URL?
The following is a JavaScript code example
Copy the code The code is as follows:

function showUploadUrl() {
for(var i=0; ivar form = document.forms[i];
for (var j=0; jif ( form.elements[j].type==="file") {
alert("The upload address is:" form.action);
}
}
}
}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn