...

View Full Version : Linking a div and making it open in a new window



jcdevelopment
08-23-2010, 05:10 PM
I am using javascript to make a DIV a link.

What would be the easiest way to set the attribute to "target=_blank?




onclick="document.location='http://google.com'"



Thanks for any help.

Eldarrion
08-23-2010, 05:23 PM
document.location doesn't work that way.


You'd want window.open instead:



onclick="window.open('http://www.google.com')"


Enjoy.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum