# 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}"/> ``` --- **結果顯示:**  ###### tags: `javascript`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up