Javascript examples for DOM HTML Element:Input FileUpload
The multiple property sets or gets whether more than one file can be selected with the file upload button.
This property reflects the HTML multiple attribute.
Set the multiple property with the following Values
Value | Description |
---|---|
true|false | Sets whether more than one file can be selected with the file upload button |
A Boolean, returns true if more than one file can be selected with the file upload button, otherwise it returns false
The following code shows how to check if a user can select more than one file with the file upload button:
<!DOCTYPE html> <html> <body> <form action="#"> Select files: <input type="file" id="myFile" name="files"> <input type="submit"> </form>/* ww w . ja v a 2s . c o m*/ <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var v = document.getElementById("myFile").multiple; document.getElementById("demo").innerHTML = v; } </script> </body> </html>