隐藏input file按钮,用同级button代替,并在button后面显示图片信息
$('#addimg').click(function () {
$('input[name="path"]').click();
});
$('input[name="path"]').on('change',function(){
var image=this.files;
$('#imge').html(image[0].name);
});
<div class="control-group"> <label class="control-label">广告图片:</label> <div class="controls"> <button class="btn btn-primary" id="addimg" type="button">选择图片</button> <input type="file" style="display: none;" name="path"/> <span id="imge"></span> <span class="form-required">*</span> </div> </div>