SOURCE

console 命令行工具 X clear

                    
>
console
const btn = document.querySelector('.btn');
const test = document.querySelector('.chunk');
btn.addEventListener('click', function() {
  test.scrollIntoView();
})
<div class="chunk"></div>
<div class="btn">click</div>
body {
  height: 200vh;
}

.chunk {
  margin-top: 30vh;
  height: 20vh;
  background: lightcoral;
}

.btn {
  padding: 10px 15px;
  position: fixed;
  right: 0;
  top: 50vh;
  background: lightgreen;
  border-radius: 10px;
  cursor: pointer;
}