HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML DOM FileUpload Object


FileUpload Object

The FileUpload object represents an HTML <input type="file"> element.

Access a FileUpload Object

You can access an <input type="file"> element by using getElementById():

var x = document.getElementById("myFile"); Try it

Tip: You can also access a FileUpload object by searching through the elements collection of a form.

Create a FileUpload Object

You can create an <input type="file"> element by using the document.createElement() method:

var x = document.createElement("INPUT");
x.setAttribute("type", "file"); Try it

FileUpload Object Properties

Property Description
accept Sets or returns the value of the accept attribute of the file upload button
disabled Sets or returns whether the file upload button is disabled, or not
form Returns a reference to the form that contains the file upload button
name Sets or returns the value of the name attribute of the file upload button
type Returns which type of form element the file upload button is
value Returns the path or the name of the selected file

Standard Properties and Events

The FileUpload object also supports the standard properties and events.


Related Pages

HTML tutorial: HTML Forms

HTML reference: HTML <input> tag

HTML reference: HTML <input> type attribute



Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE