You should save the `jQuery(currentNode).parent().contents()` as a variable so that you don't have to redo the DOM traversal (which is slow).