scroll to id in javascript code example
Example 1: js scroll to id
// Js
document.getElementById('id').scrollIntoView();
// JQuery
$('#id')[0].scrollIntoView();
Example 2: javascript scroll to element
document.getElementById("divId").scrollIntoView();