javascript - jquery append doesnt include bootstrap style after adding -


i have jquery script

$('.add-item').on('click',function(){     var url = '{% url "main:adding_from_all_products" %}';     var $this = $(this);     var product_add_name = $this.data('item-name');     $.post(url,{'product_add_name':product_add_name},function(response){         $(".test").append('<p class="product-item">'+                             '<span class="product-width-fix">' +                             response +                             '<a href="#" data-product-id=' + product_add_name +                             'class="btn btn-mini btn-success remove-product">remove</a></span></p>');     })     return true; }); 

the element add button styled bootstrap. after append done

<a href="#" data-product-id=' + product_add_name +                                     'class="btn btn-mini btn-success remove-product">remove</a></span></p> 

the button not apper, it's link withouth style. should ?

maybe need "" product_add_name :

$(".test").append('<p class="product-item">'+                                     '<span class="product-width-fix">' +                                              response +                                     '<a href="#" data-product-id="' + product_add_name +                                     '" class="btn btn-mini btn-success remove-product">remove</a></span></p>'); 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -