今天在寫HTML文件時(shí),需要一個(gè)上傳圖片的控件,自然的用了最基本的<input type="file">,結(jié)果發(fā)現(xiàn)彈窗時(shí)間特別慢,百度后才知需要加一個(gè)參數(shù)限制。
修改前代碼:
<input type="file" id="">
修改后代碼:
<input type="file" accept="image/jpeg,image/png,image/gif" id="">
今天在寫HTML文件時(shí),需要一個(gè)上傳圖片的控件,自然的用了最基本的<input type="file">,結(jié)果發(fā)現(xiàn)彈窗時(shí)間特別慢,百度后才知需要加一個(gè)參數(shù)限制。
修改前代碼:
<input type="file" id="">
修改后代碼:
<input type="file" accept="image/jpeg,image/png,image/gif" id="">