Skip to content
Related Articles

Related Articles

Improve Article
HTML | DOM Input FileUpload form Property
  • Difficulty Level : Basic
  • Last Updated : 14 May, 2021

The Input FileUpload form property in HTML DOM is used to return a reference to the form containing the file upload button. This is a read-only property and returns a form object on success.
Syntax: 
 

fileuploadObject.form

Return Values: It returns a string value which specify the reference of the form containing the Input fileUpload field

Example: 
 

html




<!DOCTYPE html>
<html>
 
<head>
    <title>
        DOM Input FileUpload form Property
    </title>
</head>
 
<body>
    <center>
        <h1 style="color:green;"
                GeeksForGeeks 
            </h1>
 
        <h2>
          DOM Input FileUpload form Property
      </h2>
        <form id="gfgForm">
            Select a file to upload:
            <input type="file"
                   id="myFile">
        </form>
 
        <button onclick="myFunction()">
          Click
      </button>
 
        <p id="demo">
      </p>
 
 
        <script>
            function myFunction() {
                var frmid =
                    document.getElementById(
                  "myFile").form.id;
               
                document.getElementById(
                  "demo").innerHTML = frmid;
            }
        </script>
    </center>
</body>
 
</html>

Output: 
Before: 
 



After: 
 

Supported Browsers: The browser supported by DOM Input FileUpload form Property are listed below: 
 

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

 




My Personal Notes arrow_drop_up
Recommended Articles
Page :