simple div tag that links to something. can’t seem to figure how to open the page in a different tab for the onclick attribute
var site_name = 'http://www.somesite.com'
var link = 'location.href='"+ site_name +"'
document.getElementById(div_name).setAttribute('onclick',link);
if i was using an a tag i would just set the target to blank but other then that i’m lost.
document.getElementById(divTagName).setAttribute('target','_blank');
1 Answer