我想向 div 标签添加一个 target 属性(参见下面的代码),以便页面“index.html”在同一页面中打开,即 target_self
<div id="home" style="cursor:pointer;
"href="javascript:void(0)"
onclick="window.open('index.html')"></div>
最佳答案
您应该从 window.open
更改为 window.location.href =
关于javascript - div标签目标属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6114761/