I want to wrap a span on wishlist link of header part in my opencart theme.
I have tried the following attempts but not succeeded any one can suggest the better way?
THIS WORKS BUT ONLY WRAPS THE SPAN FOR A SECOND AND THEN AGAIN COMES TO IT DEFAULT STATE. A CLASS(whis) IS ADDED TO 'ADD TO WISHLIST' LINK
$(document).ready(function(e) {
$('.whis').click(function(){
$("#header .links #wishlist-total").wrapInner("<span></span>");
});
});
THIS WORKS UNTILL it is clicked on 'Add to wishlist' link of product.
$(document).ready(function(e) {
$("#header .links #wishlist-total").wrapInner("<span></span>");
});
Try with jQuery .live() function
$(function() {
$(".whis").live("click", function(){
$("#header .links #wishlist-total").wrapInner("<span/>");
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With