Uncaught TypeError: $(…).replaceText is not a function

Hello I have this proplem this is my code but it give me Uncaught TypeError: $(…).replaceText is not a function

$(".social-counter").each(function() {
    var a = $(this);
    var b = $(this).find(".item-social");
    if (0 === b.length) a.remove();
    $(this).find(".widget").removeClass("LinkList");
    $(".item-social.facebook").find(".item-text").text("Likes");
    $(".item-social.rss,.social-counter .item-social.youtube").find(".item-text").text("Subscribes");
    var c = "count=";
    var d = ";";
    $(".social-counter *").replaceText(c, '<span class="item-count">');
    $(".social-counter *").replaceText(d, "</span>");
    $(".item-social").each(function() {
        var a = $(this).find(".hide-count");
        var b = $(this).find(".item-count");
        $(a).before($(b));
        $(a).remove()
    })
});

any one can help me and thanks for any help

1 thought on “Uncaught TypeError: $(…).replaceText is not a function”

  1. Are you trying to use replace or replaceWith? or is replaceText() a custom function you have?
    Maybe try only .replace(old_string, new_string)

    Reply

Leave a Comment