jquery append 方法添加多个标签!!
function addSpot(obj, sm) {
$('div#spots').append(
'<div class="spot">' +
'证书:<input type="file" name="spot_title"/> <br/>' +
'证书名称:<input type="text" name="addr"/> <br/>' +
'证书编号:<input type="text" name="url"/> ' +
'办法时间:<input type="text" class="easyui-datebox" name="url"/> ' +
'<input type="button" class="remove" value="Delete"/></div>')
.find("input.remove").click(function () {
if ($('div.spot').size() == sm) {
$(obj).show();
}
$(this).parent().remove();
$('input#add').show();
});
$('div#spots').trigger('create');
if ($('div.spot').size() >= sm) {
$(obj).hide();
}
};
标签是可以添加, 添加过后css丢失, 解决办法。
谢绝粘贴党,谢谢