如题所述
æç»ä¸ªä¾åç»ä½ å§ï¼
<script>
function he(){
var file=document.getElementById("haa").files[0];
console.log(file);
alert(file['name']);
}
</script>
</head>
<body>
<input type="file" id="haa" onchange="he()"/>
</body>
</html>
<script>
function he(){
var file=document.getElementById("haa").files[0];
console.log(file);
alert(file['name']);
}
</script>
</head>
<body>
<input type="file" id="haa" onchange="he()"/>
</body>
</html>
温馨提示:答案为网友推荐,仅供参考