首页javascriptfile_uploadJavascript Form - 如何获取文件上传输入框的TYPE属性

Javascript Form - 如何获取文件上传输入框的TYPE属性

我们想知道如何获取文件上传输入框的TYPE属性。

 
<html>
<body>
    <script language="JavaScript">
    function getType(){
         var mytype = document.form1.uploadbox.type;
         console.log("The input box type is: " + mytype);
    }
    </script>
    <form name="form1">
    <input type="file" name="uploadbox">
    <br><br>
    Click on the button below.
    <br>
    <input type="button" value="Get Type" onClick='getType()'>
    </form>
</body>
</html>