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 attribute.

Syntax:

  • It returns the Input FileUpload multiple property.
    fileuploadObject.multiple
  • It is used to set the Input FileUpload multiple property.
    fileuploadObject.multiple = true|false

Property Values:



  • true: It allows to select more than one file with the file upload Button.
  • False: It does not allow to select more than one file with the FileUpload Button.

Return Value: It returns a Boolean value which specify that the user is allowed to select multiple file or not with the File UpLoad Button.

Example 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!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() { 
            var x = document.getElementById("geeks").multiple; 
  
            document.getElementById("GFG").innerHTML = x; 
        
        </script
    </center
</body
  
</html>

chevron_right


Output:

  • Before Clicking on Button:
  • After Clicking on Button:

Example 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!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() { 
            var x = document.getElementById("geeks").multiple
                    = "false"; 
  
            document.getElementById("GFG").innerHTML 
                    = "The value of the multiple attribute"
                    + " was changed to " + x; 
        
    </script
</body
  
</html>

chevron_right


  • Before Clicking On button :
  • After Clicking On Button:

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

  • Google Chrome
  • Internet Explorer 10.0
  • Firefox
  • Safari
  • Opera


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.