[SOLVED] Append not working

$(".fsCalendar .fsLoadMoreButton").prependTo($(this).parentsUntil(".fsCalendar").children(".fsElementContent")).text("View Events Calendar");

ht tp://yo koh ama.re design.fin alsite. com/

Look at the teal calendar halfway down the page. I’m trying to append that “view events calendar” up the DOM. I have multiple calendars on this page so I need it to only append to its direct parent.

What’s wrong with my jQuery? It’s not appending. No errors in console.

No console errors but looks to be inserted twice for me Firefox latest.

More than one match for the selector?
Is there an “each” somewhere?

The View Events Calendar is automatically generated. I’m trying an each loop now.

Meh - can’t get it. Still working on it but here’s my preliminary loop

$(".fsCalendar .fsLoadMoreButton").each(function() {
    $(this).prependTo($(this).parentsUntil(".fsCalendar").find(".fsElementContent")).text("View Events Calendar");
$(".fsCalendar .fsLoadMoreButton").each(function() {
  $(this).prependTo($(this).closest(".fsCalendar").find(".fsElementContent")).text("View Events Calendar");


Amazing what a short break + fresh eyes on the problem can do…

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.