jquery move to element code example

Example 1: scroll to element jquery

$('html, body').animate({
  scrollTop: $("#grepperRocks").offset().top
});

Example 2: jquery scroll to element

$("#button").click(function() {
    $([document.documentElement, document.body]).animate({
        scrollTop: $("#elementtoScrollToID").offset().top
    }, 2000);
});

Example 3: jquery move element

$("#source").appendTo("#destination");

Example 4: how to move div using jquery

$('#destination').append( $('#source') );

Example 5: move an element into another jquery

$('#source').appendTo('#destination');