I have a div
with a class of "second". I would like to scroll to that element in the page when a button
is clicked. Below is how I wrote it using jQuery but I'd like to know how to write this in vanilla JavaScript?
$("button").click(function() {
$('html,body').animate({
scrollTop: $(".second").offset().top},
'slow');
});