开发者

Javascript onclick div element load page similar to link

开发者 https://www.devze.com 2023-02-13 07:54 出处:网络
How do I load another page on the onClick event in Javascript? <div id=\"div_man\" onclick=\"/subfolder/index.htm\"></div>

How do I load another page on the onClick event in Javascript?

<div id="div_man" onclick="/subfolder/index.htm"></div>

The code above is not working. Please explain. I am sure it's quite simple. Thanks in advan开发者_StackOverflow社区ce!


<div id="div_man" onclick="location.href='/subfolder/index.htm'"></div>

Here's a working example: http://jsfiddle.net/ArtBIT/EEjyP/

0

精彩评论

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