Reputation: 379
I have an iframe advertisment on my site, and i want when I click it to automatically opens in another tab. But I don't really know how to do it. I am trying with that way but it isnt working:
document.getElementById("ad_frame").contentWindow.document.body.click()
Upvotes: 0
Views: 79
Reputation: 679
You can simply do it by window.open()
function.
Like that:
<script language="javascript">
window.open("http://www.ad-site.com");
</script>
If this doesn't answer the question, please specify the question better.
Upvotes: 1