Add remove section of elements – Snippet on JSFiddle

Add remove section of elements – Snippet on JSFiddle

source: http://jsfiddle.net/webeswork/cjf0j9zm/6/

jQuery(document).ready(function() {

//add element
jQuery(“#book_add_btn”).click(function() {

jQuery(‘#book_collection’).append(jQuery(“#book_collection .book_wrapper:last-child”).clone());
jQuery(“#book_collection .book_wrapper:last-child input[type=text]”).val(”);

});

//remove element
jQuery(“.book_wrapper .imagecheckbox”).live(“click”, function() {
if (jQuery(this).parent().parent().children().length > 1) {
jQuery(this).parent().remove();
}
});

});

 

 

B logbook : PHP | Javascript | Laravel | CodeIgniter | VueJs | ReactJs | WordPress

Translate »