Moving HTML Content On Page with jQuery

By March 5, 2016March 20th, 2017Blog, Javascript, jQuery
Allure Web Solutions Code Snippet
$('table:last-child tr').each(function() {
removeLink = $(this).find('a').detach(); // use detach() to "cut" the selected element
$(this).find('span').append(removeLink); // paste selected element

CodePen Example

In this example, I’m moving the first column links into the second column (after the text already in the second column) and replacing the link text with a smiley face.

Mike Doubintchik

Author Mike Doubintchik

More posts by Mike Doubintchik

Leave a Reply