title: Uncaught TypeError: Cannot set property 'href' of null
body: <ul>
  <li>I am trying to download the file from the grid.
  
  <ul>
  <li>when I click open first window link a popup opens.</li>
  <li>in that popup you will see a grid.</li>
  <li>but right now you will see the grid but an error is happening at the below line.</li>
  <li>I am trying to download the file like this functionality
  <a href="https://jsfiddle.net/335t5aow/" rel="nofollow noreferrer">https://jsfiddle.net/335t5aow/</a></li>
  </ul></li>
  </ul>
  
  <p>Uncaught TypeError: Cannot set property 'href' of null</p>
  
  
  
  <pre class="lang-or-tag-here prettyprint-override"><code>template: "&lt;a class=\"sportsDataPlayer\" onclick=\"window.open('#= FileName#', 'popup', 'width=800,height=600,scrollbars=yes,resizable=no')\"&gt;#= FileName.substring(FileName.lastIndexOf('/')+1) #&lt;/a&gt;"
  </code></pre>
  
  <ul>
  <li>can you guys tell me how to fix it.</li>
  <li>providing code below</li>
  </ul>
  
  <p><a href="http://jsfiddle.net/savyjgg2/2/" rel="nofollow noreferrer">http://jsfiddle.net/savyjgg2/2/</a></p>
  
   
  
  <pre class="lang-or-tag-here prettyprint-override"><code>template: "&lt;a class=\"sportsDataPlayer\" onclick=\"window.open('#= FileName#', 'popup', 'width=800,height=600,scrollbars=yes,resizable=no')\"&gt;#= FileName.substring(FileName.lastIndexOf('/')+1) #&lt;/a&gt;"    
  var csv = "a,b,c\n1,2,3\n";
  var data = new Blob([csv]);
  var a2 = document.getElementById(".sportsDataPlayer");
  alert("I am here");
  a2.href = URL.createObjectURL(data);
  </code></pre>