How to Prevent from focusing on new tab open

Ever you tried open new tab on page load and don't want to browser focuse on newly opend tab, well this trick will help you to achive this.

   var url = '';
   var myWindow =,name,'_blank');;

If you want to use this code on page load you can to it like this.

first set this

<body onload="red()">

then put this code anywhere you want on page but inside <body> {your code}</body> tag

<script type="text/javascript">
 function red(){
   var url = '';
   var myWindow =,name,'_blank');;

this code will open new tab and send to background.

Thank you.

Other posts