Most answers are unnecessarily complicated.
If you just want to jump to the target element, you don't need JavaScript:
# the link:
<a href="#target">Click here to jump.</a>
# target element:
<div id="target">Any kind of element.</div>
If you want to scroll to the target animatedly, please refer to @Shahil's answer5hahiL's answer.