Input Button value Attribute
Definition and Usage
value
The property returns the path or name of the file selected using the <input type="file"> element.
This property returns the name of the selected file with a fake path in IE, Google Chrome, and Opera, and the name of the selected file in Firefox and Safari.
Note:For security reasons, this property is read-only.
Example
Display the path or name of the selected file:
var x = document.getElementById("myFile").value;
Syntax
fileuploadObject.value
Technical Details
Return Value: | A string value representing the path or name of the selected file. |
---|
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |