javascript function id code example
Example 1: js scroll to id
// Js
document.getElementById('id').scrollIntoView();
// JQuery
$('#id')[0].scrollIntoView();
Example 2: jquery get id value
var myId = $(this).attr('id');
alert( myId );
// Js
document.getElementById('id').scrollIntoView();
// JQuery
$('#id')[0].scrollIntoView();
var myId = $(this).attr('id');
alert( myId );