var element = document.getElementById("box"); element.scrollIntoView();//顶部 element.scrollIntoView(false);//底部 element.scrollIntoView({block: "end"}); element.scrollIntoView({behavior: "instant", block: "end", inline: "nearest"});