开发者

Div tag target attribute

开发者 https://www.devze.com 2023-03-08 13:59 出处:网络
I would like to add a target attribute to a div tag (see code below) so that the page \"index.html\" opens in the same page i.e target_self

I would like to add a target attribute to a div tag (see code below) so that the page "index.html" opens in the same page i.e target_self

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


You should change from window.open to window.location.href =

0

精彩评论

暂无评论...
验证码 换一张
取 消