The type
property returns type of the file upload button.
type |
Yes | Yes | Yes | Yes | Yes |
var v = fileuploadObject.type
Type | Description |
---|---|
String | The type of the file upload button |
The following code shows how to get the type of the file upload button.
<!DOCTYPE html>
<html>
<body>
<!-- ww w . j av a2 s .c o m-->
Select a file to upload:
<input type="file" id="myFile">
<button onclick="myFunction()">test</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myFile").type;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>
The code above is rendered as follows: