I am new to JS. I am trying to write function on onclick event listener to get the # value and to pass the value to another function. Can you please help me. When user try to click the a tag i want to capture the # value and to pass the href value to the below function for scroll top offset
<ul class="scrolltop scrolltop">
<li>
<a href="#Covered">What’s covered</a>
</li>
<li>
<a href="#Collect">Personal Information</a>
</li>
</ul>
var tabScroll = document.querySelector("#Collect")
window.scrollTo({
'behavior': 'smooth',
'left': 0,
'top': tabScroll.offsetTop - 110
});