FileUpload typeプロパティ
Fileupload オブジェクト
定義と使用方法
type プロパティは FileUpload オブジェクトの form 要素のタイプを返します。
FileUpload オブジェクトの場合、このプロパティは "file" を返します。
構文
fileuploadObject.type
ブラウザサポート
![]()
![]()
![]()
![]()
![]()
すべての主要ブラウザは type プロパティをサポートしています
例
例
FileUpload オブジェクトの form 要素のタイプを表示します:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>サンプル(example.com)</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>サンプル(example.com)</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 オブジェクト その他の拡張