HTML | DOM Input FileUpload accept Property Last Updated : 29 Aug, 2022 Comments Improve Suggest changes Like Article Like Report The DOM Input FileUpload accept Property in HTML DOM is used to set or return the value of the accept attribute of the file upload button. The accept attribute specifies the types of files which are acceptable by that the server. Syntax: Return the accept property:fileuploadObject.acceptSet the accept property:fileuploadObject.accept="audio/*, video/*, image/*, MIME_type" Property Values: audio/* : All sound files are acceptablevideo/* : All video files are acceptableimage/* : All image files are acceptableMIME_type : A valid MIME type, with no parameters. Return Value: It returns the string value which represent the type of the accepted file. Example-1: Return the accepted file type. HTML <!DOCTYPE html> <html> <head> <style> h1 { color: green; } </style> </head> <body> <center> <h1> Geeeks for Geeks </h1> <p>Select a file to upload: <input type="file" id="myFile" size="50" accept="video/*"> </p> <button onclick="myFunction()"> File type </button> <p id="demo"></p> <script> function myFunction() { var gfg = document.getElementById( "myFile").accept; document.getElementById( "demo").innerHTML = gfg; } </script> </center> </body> </html> Output: Before Click: After Click: Examples: Set the accepted file type. HTML <!DOCTYPE html> <html> <head> <style> h1 { color: green; } </style> </head> <body> <center> <h1> Geeks for Geeks </h1> <p>Select a file to upload: <input type="file" id="myFile" size="50" accept="video/*"> </p> <button onclick="myFunction()"> File type </button> <p id="demo"></p> <script> function myFunction() { var gfg = document.getElementById( "myFile").accept = "audio/*,video/*"; document.getElementById( "demo").innerHTML = gfg; } </script> </center> </body> </html> Output: Before Click: After Click: Supported Browsers: Google Chrome 1+Mozilla Firefox 1+Edge 12+Opera 11+Safari 1+ Comment More infoAdvertise with us Next Article HTML | DOM Input FileUpload form Property V Vijay Sirra Follow Improve Article Tags : Misc Web Technologies HTML HTML-DOM HTML-Property +1 More Practice Tags : Misc Similar Reads HTML DOM Input FileUpload disabled Property The Input FileUpload disabled property in HTML DOM used to set or return whether a file upload field must be disabled, or not. A disabled field is unusable and un-clickable. It is a boolean attribute and used to reflect the HTML Disabled attribute. It is usually rendered in grey color by default in 2 min read HTML DOM Input FileUpload autofocus Property The Input FileUpload autofocus property in HTML DOM is used to set or return whether a file upload button should automatically get focus when the page loads, or not. Syntax: Return the autofocus property:fileuploadObject.autofocusSet the autofocus property:fileuploadObject.autofocus=true|false Prope 1 min read HTML | DOM Input FileUpload form Property 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 for 1 min read HTML | DOM Input FileUpload type Property The Input FileUpload type Property is used in HTML DOM to return the type of form element the file upload button is. This property will always return "file" for a file upload button. Syntax: fileuploadObject.type Return Value: It returns a string value that represents the type of form element the fi 1 min read HTML | DOM Input FileUpload name Property The name property is used to set or return the value of the name attribute of a file upload button. The name attribute is used to identify form data after the submission to the server. Syntax: Return the name property:fileuploadObject.nameSet the name property:fileuploadObject.name=name Property Val 1 min read HTML | DOM Input FileUpload value Property The Input FileUpload value Property is used to returns the path or the name of the file selected with the element. This property is used to return the name of the selected file with a fake path in IE, Google Chrome, and Opera, and return the name of the selected file in Firefox and Safari. This prop 1 min read Like