Click here to Skip to main content
15,743,713 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

When we keep target="_blank" for a tag the new window will open in new tab and it is directly visible to us. My requirement is to open new window but the main window should be first visible, not the new window. Wat to do can anybody help??

Updated 19-Jul-12 23:43pm

1 solution

Hi Venkat,

Do it like this using javascript:

<script type="text/javascript" language="javascript">

function OpenURL(url)


<a href="javascript:OpenURL('');"> Go Google </a>


Accept this as answer if it helps you. Good Luck!

Happy Coding :)
Share this answer
Venkat_C6 20-Jul-12 6:25am    
Hi Sunny thanks for ur reply.. But with this also im not getting. It also showing the new tab opened but not the current tab page.
Sunny_Kumar_ 20-Jul-12 6:47am    
share the code that you've tried so far to achieve this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900