dadamssg Posted July 8, 2009 Share Posted July 8, 2009 i'm trying to make a div a link and then make it open it up in a new tab. heres what i have and its clickable but it doesn't do anything. <div id="twitter" onclick="window.open("http://www.twitter.com/test")></div> can anybody help? Link to comment https://forums.phpfreaks.com/topic/165148-help-with-opening-new-window/ Share on other sites More sharing options...
corbin Posted July 8, 2009 Share Posted July 8, 2009 <div id="twitter" onclick="window.open("http://www.twitter.com/test")></div> Should be <div id="twitter" onclick="window.open('http://www.twitter.com/test')"></div> You were missing a closing quote on the onclick attribute, and you can't use double quotes inside of double quotes. Link to comment https://forums.phpfreaks.com/topic/165148-help-with-opening-new-window/#findComment-870832 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.