title: JavaScript open new window, but focus shoud remain on old window
body: <p><strong>Objective</strong> : </p>
  
  <p>I want to open a new window but the focus remain on old window.</p>
  
  <p><strong>what I tried :</strong> </p>
  
  <pre><code>&lt;button id="test"&gt;Open Google&lt;/button&gt;
  </code></pre>
  
  <p>-</p>
  
  <pre><code>document.getElementById("test").addEventListener("click", openNewBackgroundTab, false);
  
  function openNewBackgroundTab(){
      var a = document.createElement("a");
      a.href = "http://www.google.com/";
      var evt = document.createEvent("MouseEvents");    
      evt.initMouseEvent("click", true, true, 
                          window, 0, 0, 0, 0, 0, 
                          true, false, false, false, 
                          0, null);
      a.dispatchEvent(evt);
  }
  </code></pre>
  
  <p>Here is the link : <a href="http://jsfiddle.net/3ZmvS/5/" rel="nofollow">JSFiddle</a></p>
  
  <p>This works fine in Chrome but not in Mozilla. </p>
  
  <p>Please help !!</p>