本帖最后由 nfclass 于 2011-07-17 11:08:08 编辑

解决方案 »

  1.   

    这样试试<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
    </head>
    <body>
    <input type="file" id="subattname" />
    <input type="button" onclick="fn()" value="Btn" />
    <script type="text/javascript">
        function fn() {
            var f = document.getElementById('subattname');
            alert(f.value);
            f.outerHTML += '';//ie
            f.value=''; //firefox
        }
    </script>
    </body>
    </html>,取不到file名,你是怎么取的呢?