# FileReader 讀取文字內容 [參考網站](https://blog.csdn.net/lucky541788/article/details/86675495) --- [前情提要](https://hackmd.io/cv00DXFxQv2Kh1RbMtClxg) ```javascript=\ //讀取file的txt內容 var reader = new FileReader(); reader.readAsText(file); reader.onload = function(){ $("#mobile").val(reader.result); } <s:textarea label="smsMaintainAddVo.mobile" name="smsMaintainAddVo.mobile" id="mobile" cols="80" rows="10" style="resize:none" maxLength="80" value="%{smsMaintainAddVo.mobile}"/> ``` --- **結果顯示:** ![](https://i.imgur.com/O6aXaF0.jpg) ###### tags: `javascript`