阅读:1659回复:0
疑似Bug? input type="file" value取不到正确的值?
<html>
<body> <form id="form1" name="form1"> <input id="file1" name="file1" type="file"> </form> <input type="button" value="button" onclick="javascript:alert(document.getElementById('file1').value);"> </body> </html> 选择了一个文件后, input 的 value 属性中显示的是带全路径的文件, JS取出来的确只有文件,没有路径.(firefox 3.0, 4.0 测试不行,只有2.0可以取出带全路径的文件) |
|