$('.menu-item-text').click(function(){
let b = $(this).attr('href').replace('#', '');
$('[name="'+b+'"]').scrollIntoView({block: "center", behavior: "smooth"})
})
document.addEventListener('click', function myClickHandler(evt) {
const menuItem = evt.target.closest('.menu-item-text');
if (menuItem) {
const b = menuItem.href.hash.replace('#', '');
console.log(b);
}
});