Open In App

HTML DOM Input FileUpload multiple Property

The Input FileUpload multiple Property in HTML DOM is used to set or return one or multiple files selected with the file upload button. It contains a Boolean value which is true when the user is allowed to select more than one file. This property is used to reflect the HTML multiple attributes. 

Syntax: 



fileuploadObject.multiple
fileuploadObject.multiple = true|false

Property Values:

Return Value: It returns a Boolean value that specifies whether the user is allowed to select multiple files or not with the File UpLoad Button. 



Example 1: In this example, we will use the  Input FileUpload multiple Property.




<!DOCTYPE html>
<html>
   
<head>
    <title>
        HTML DOM Input FileUpload multiple Property
    </title>
</head>
 
<body style="text-align:center;">
    <h1 style="color:green;">
        GeeksforGeeks
    </h1>
    <h2>
        HTML DOM Input FileUpload multiple Property
    </h2>
    <input type="file" id="geeks" multiple>
    <br><br>
    <button onclick="myFunction()">
        Click
    </button>
    <p id="GFG" style="Font-size:20px;"></p>
   
    <script>
        function myFunction() {
            let x = document.getElementById("geeks").multiple;
 
            document.getElementById("GFG").innerHTML = x;
        }
    </script>
</body>
 
</html>

Output:

 

Example 2: In this example, we will see the use of Input FileUpload multiple Property.




<!DOCTYPE html>
<html>
   
<head>
    <title>
        HTML DOM Input FileUpload multiple Property
    </title>
</head>
 
<body style="text-align:center;">
    <h1 style="color:green;">
        GeeksforGeeks
    </h1>
    <h2>
        HTML DOM Input FileUpload multiple Property
    </h2>
    <input type="file" id="geeks" multiple>
    <br><br>
    <button onclick="myFunction()">
        Click
    </button>
    <p id="GFG" style="Font-size:20px;"></p>
   
    <script>
        function myFunction() {
            let x = document.getElementById("geeks").multiple
                = "false";
            document.getElementById("GFG").innerHTML
                = "The value of the multiple attribute"
                + " was changed to " + x;
        }
    </script>
</body>
 
</html>

Output:

 

Supported Browsers: The browsers supported by HTML DOM Input FileUpload multiple Property are listed below:


Article Tags :