HTML 1.主要用到input框里面 type=flie 类型 <form id ="form1"> <div> <label for="inputfile" style="color: #ffffff;">请上传公会头像</label> <input type="file" id="inputfile" onchange="imgbase()"> </div