Oggetto HTML DOM Input FileUpload
Inserisci l'oggetto FileUpload
L'oggetto Input FileUpload rappresenta un elemento HTML <input> con type="file".
Accedi a un oggetto FileUpload di input
Puoi accedere a un elemento <input> con type="file" usando getElementById():
Esempio
var x = document.getElementById("myFile");
Suggerimento: puoi anche accedere a <input type="file"> cercando nella raccolta di elementi di un modulo.
Crea un oggetto FileUpload di input
Puoi creare un elemento <input> con type="file" usando il metodo document.createElement():
Esempio
var x = document.createElement("INPUT");
x.setAttribute("type", "file");
Immettere le proprietà dell'oggetto FileUpload
Property | Description |
---|---|
accept | Sets or returns the value of the accept attribute of the file upload button |
autofocus | Sets or returns whether a file upload button should automatically get focus upon page load |
defaultValue | Sets or returns the default value of the file upload button |
disabled | Sets or returns whether the file upload button is disabled, or not |
files | Returns a FileList object that represents the file or files selected with the file upload button |
form | Returns a reference to the form that contains the file upload button |
multiple | Sets or returns whether a user is allowed to select more than one file in the file upload field |
name | Sets or returns the value of the name attribute of the file upload button |
required | Sets or returns whether a file in the file upload field must be selected before submitting a form |
type | Returns which type of form element the file upload button is |
value | Returns the path or the name of the selected file |
Proprietà ed eventi standard
L'oggetto Input FileUpload supporta anche le proprietà e gli eventi standard .
Pagine correlate
Esercitazione HTML: Moduli HTML
Riferimento HTML: tag HTML <input>
Riferimento HTML: attributo tipo HTML <input>