Skip to content
Related Articles

Related Articles

HTML | DOM Input FileUpload form Property
  • Difficulty Level : Basic
  • Last Updated : 26 Mar, 2019

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

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!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>

chevron_right


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

full-stack-img




My Personal Notes arrow_drop_up
Recommended Articles
Page :