JavaScript 参考手册教程
HTML DOM FileUpload type 属性
HTML DOM FileUpload type 属性
FileUpload type 属性
Fileupload 对象定义和用法
type 属性返回 FileUpload 对象的 form 元素类型。
对于 FileUpload 对象,该属性返回 "file"。
语法
fileuploadObject.type
浏览器支持
所有主要浏览器都支持 type 属性
实例
实例
显示 FileUpload 对象的 form 元素的类型:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>非常教程(verydoc.net)</title>
<script>
function displayResult(){
var x=document.getElementById("fname").type;
alert(x);
}
</script>
</head>
<body>
<form>
选择一个文件上传:
<input type="file" id="fname">
</form>
<button type="button" onclick="displayResult()">显示 input 类型</button>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>非常教程(verydoc.net)</title>
<script>
function displayResult(){
var x=document.getElementById("fname").type;
alert(x);
}
</script>
</head>
<body>
<form>
选择一个文件上传:
<input type="file" id="fname">
</form>
<button type="button" onclick="displayResult()">显示 input 类型</button>
</body>
</html>
尝试一下 »
Fileupload 对象
HTML DOM FileUpload type 属性 |
---|
JavaScript 参考手册
JavaScript 参考手册提供了完整的 JavaScript 对象、浏览器对象、HTML DOM 对象手册。手册包含了每个对象、属性、方法的实例。