<form>
<label>书名</label><input type="text" id="name" name="name" /> <br />
<label>作者</label><input type="text" id="author" name="author" /> <br />
<label>出版社</label><input type="text" id="press" name="press" /> <br />
<label>出版时间</label><input type="date" id="pressDate" name="pressDate" /> <br />
<label>图书描述</label><input type="text" id="describe" name="describe" /> <br />
<input type="file" onchange="change(this)" id="bookImg" name="bookImg"> <br />
<img id="upLoadImg" /> <br /> <input type="submit" id="submitButton" />
</form>
function change(img) {
var file = img.files[0];
var path = window.URL.createObjectURL(file);
console.log(path);
$("#upLoadImg").attr('src', path);
}
$("bookImg").get(0).files[0]
var inputTag = document.getElementById("bookImg");
var img = inputTag.files[0];