Div标记目标属性

时间:2011-05-24 17:58:56

标签: javascript html

我想在div标签中添加一个target属性(参见下面的代码),以便页面“index.html”在同一页面中打开,即target_self

  <div id="home" style="cursor:pointer;
                 "href="javascript:void(0)" 
                 onclick="window.open('index.html')"></div>

1 个答案:

答案 0 :(得分:0)

您应该从window.open更改为window.location.href =

相关问题