- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML DOM Input FileUpload form Property
The HTML DOM input FileUpload form property returns the reference of the form which enclose the file upload input button.
Syntax
Following is the syntax −
object.form
Example
Let us see an example of input FileUpload form property −
<!DOCTYPE html> <html> <head> <style> body{ text-align:center; background-color:#363946; color:#fff; } form{ margin:2.5rem auto; } button{ background-color:#db133a; border:none; cursor:pointer; padding:8px 16px; color:#fff; border-radius:5px; font-size:1.05rem; } .show{ font-weight:bold; font-size:1.4rem; } </style> </head> <body> <h1>form Property Demo</h1> <form id="Form 1"> <fieldset> <legend>Form 1</legend> <input type="file" class="fileUploadBtn"> </fieldset> </form> <button onclick="identify()">Identify File Upload button Form</button> <p class="show"></p> <script> function identify() { var formId = document.querySelector(".fileUploadBtn").form.id; document.querySelector(".show").innerHTML = "Hi! I'm from " + formId; } </script> </body> </html>
Output
This will produce the following output −
Click on “Identify File Upload Button Form” button to identify the form which contain the file upload button.
- Related Articles
- HTML DOM Input FileUpload disabled Property
- HTML DOM Input FileUpload files Property
- HTML DOM Input FileUpload name Property
- HTML DOM Input FileUpload value Property
- HTML DOM Input FileUpload required Property
- HTML DOM Input FileUpload type Property
- HTML DOM Input FileUpload accept Property
- HTML DOM Input FileUpload autofocus Property
- HTML DOM Input FileUpload Object
- HTML DOM Input Button form Property
- HTML DOM Input Hidden form Property
- HTML DOM Input Month form Property
- HTML DOM Input Number form Property
- HTML DOM Input Checkbox form Property
- HTML DOM Input Color form Property

Advertisements