我有一个选择选项,点击后,它会将表单属性从display: none
更改为display: block
,并将windows.hash更改为其他内容,但在Chrome中,视图会自动向下滚动并关注表格。你如何防止这种行为?
function mainTypeChange(element){
if ("business" == element.options[element.selectedIndex].value) {
window.location.hash = "business";
} else {
document.getElementById("requestQuote").style.display = 'block';
window.location.hash = "requestQuote";
}
}