Easy Tutorial
❮ Prop Text Autofocus Prop Style Wordwrap ❯

FileUpload type Attribute


Definition and Usage

The type attribute returns the form element type of the FileUpload object.

For a FileUpload object, this attribute returns "file".

Syntax


Browser Support

All major browsers support the type attribute.


Example

Display the type of the form element for the FileUpload object:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>tutorialpro.org(tutorialpro.org)</title>
<script>
function displayResult(){
    var x = document.getElementById("fname").type;
    alert(x);
}
</script>
</head>
<body>

<form>
Select a file to upload:
<input type="file" id="fname">
</form>
<button type="button" onclick="displayResult()">Display input type</button>

</body>
</html>

❮ Prop Text Autofocus Prop Style Wordwrap ❯