HTML input file中把瀏覽按鈕變成英文


1、頁面上放個隱藏的<input type="file" />
2、然后加上一個文本<input type="text" />和一個按鈕<input type="button" />
3、點按鈕的時候調用<input type="file" />的click選擇文件
4、在<input type="file" />的onchange事件中把其值顯示在文本input中
5、注意把文本input設置成只讀的,防止出錯
<form name="form_en">
<input type="file" name="picpath" id="picpath" style="display:none" onChange="document.form_en.path.value=this.value">
<input name="path" readonly> 
<input type="button" value="Browse" onclick="document.form_en.picpath.click()"> 
</form>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM