源码

<html>
    <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>鼠标放到文字上跳转到锚点</title>

<script type="text/javascript" language="javascript" >
<!--
function a(){    
    
               document.querySelector("#w").scrollIntoView(true);
           }
           
           
</script>
</head>
<body>

<a href="#" style="hover:background-color:"  onmouseover="a()" onmouseout="a()">鼠标放到这即跳转到锚点</a>

<div style="height:2111px ; background-color: rgb(255, 153, 0);"  ></div>

<h1 id="w">锚点</h1>
</body>
</html>

示例

鼠标放到这即跳转到锚点

锚点