dropzone js中的默认代码是这样的
Dropzone.prototype.defaultOptions = {
dictRemoveFile: "Remove file"}
if (this.options.addRemoveLinks) {
file._removeLink = Dropzone.createElement("<a class=\"dz-remove btn btn-default\" href=\"javascript:undefined;\" data-dz-remove>" + this.options.dictRemoveFile + "</a>");
file.previewElement.appendChild(file._removeLink);
}
我尝试这样做
if (this.options.addRemoveLinks) {
file._removeLink = Dropzone.createElement("<div class=\"custom-btn\"><a class=\"dz-remove btn btn-default\" href=\"javascript:undefined;\" data-dz-remove>" + this.options.dictRemoveFile + "</a><div>");
file.previewElement.appendChild(file._removeLink);
}
我的代码就像这样
<form action="/file-upload" class="dropzone">
<div class="fallback">
<input name="file" type="file" multiple />
</div>
</form>
.custom-btn{
background:red;
margin:auto;
display:inline-block;
但是当我尝试检查元素时,它只读
<div class="custom-btn">Remove file</div>
有人可以帮助在标记a
感谢