I don't like this way to remove child nodes, it's not reliable. please move your template out of `cardsInfo` div and then simply remove all children under it.