最佳答案
我有一个搜索输入文本,我想应用一个 focus()
当加载页面,问题是 focus
函数自动做一个滚动到这个领域。有办法禁用这个卷轴吗?
<input id="search_terms" type="text" />
<script>
document.getelementbyId('search-terms').focus();
</script>