Inside a div with scroll, when I press the button CLICK ME, the script below should scroll to the text "SHOULD GO HERE". Something similar to an anchor link.
JsFiddle: https://jsfiddle.net/hhqnjojr/2/
Instead, the script scrolls to a random position (?) way above the text "SHOULD GO HERE". Please, what am I doing wrong?
$("#my_button").click(function() {
$('#wrapper_div').animate({
scrollTop: $("#go_here").offset().top
}, 2000);
});