title: delete attribute CSS DOM JS
body: <p>I would like to know what is wrong in my code.
  I'd like to delete all "link" tags if there is within the attribute "rel = "stylesheet"</p>
  
  <p>This is my HTML code</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;teset&lt;/title&gt;
  &lt;meta charset="utf-8" /&gt;
  &lt;meta name="description" content="test." /&gt;
  &lt;meta name="author" content="Me" /&gt;
  &lt;link rel="author" href="www.mysite.uk" /&gt;
  &lt;link rel="stylesheet" type="text/css" href="www.mysite.uk/css/style.css  /&gt;
  &lt;link rel="stylesheet" type="text/css" href="www.mysite.uk/css/style2.css /&gt;
  &lt;/head&gt;
  &lt;script src = "deleteCSS.js"&gt;&lt;/script&gt;
  &lt;body onload="noCSS()"&gt;
  &lt;p&gt; test !!&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This is my JS called "deleteCSS.js"</p>
  
  <pre><code>function noCSS(){ 
  //I save tag "link"
  var CSSlink = document.getElementsByTagName("link"); 
  var CSSatt = CSSlink.getAttribute("rel");
  
  for (i=0; i &lt; CSSlink.length; i++){  
  if (CSSatt[i] == "stylesheet"){
  CSSlink[i].remove(); }
  }
  }
  </code></pre>