Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript onclick div element load page similar to link

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 advance!

like image 803
Web_Designer Avatar asked Feb 26 '11 02:02

Web_Designer


1 Answers

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

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

like image 98
ArtBIT Avatar answered Oct 16 '22 21:10

ArtBIT