我正在尝试将页面移至某个<div>元素。
<div>
我尝试下一个代码无济于事:
document.getElementById("divFirst").style.visibility = 'visible'; document.getElementById("divFirst").style.display = 'block';
您可以使用锚点来“聚焦” div。即:
<div id="myDiv"></div>
然后使用以下javascript:
// the next line is required to work around a bug in WebKit (Chrome / Safari) location.href = "#"; location.href = "#myDiv";