title: JavascriptExecutor: Cannot read property 'removeAttribute' of null
body: <p>I am using Javascript executor to remove <code>readonly</code> attribute but it is giving an error.
  <code>Cannot read property 'removeAttribute' of null</code>.</p>
  
  <p>I have seen different posts where people confirm that after removing AdBlock from Chrome it worked. I don't know what is AdBlock and how to remove it from Chrome Binary at runtime, so I tried Firefox (Gecko Driver) but it is also throwing the same error.</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>driver.get("http://jsfiddle.net/343Rb/");
  runJS().executeScript("document.getElementById('myInput').removeAttribute('readonly')");
  </code></pre>
  
  <p>Browsers I tried:
  Chrome Binary latest, Firefox (GeckoDriver latest) on Windows 7</p>
  
  <p>Links I went through:</p>
  
  <ol>
  <li><a href="https://stackoverflow.com/questions/37688197/typeerror-cannot-read-property-removeattribute-of-null">TypeError: Cannot read property &quot;removeAttribute&quot; of null</a></li>
  <li><a href="https://stackoverflow.com/questions/38143879/cannot-read-property-removeattribute-of-null-cant-find-source-of-it">Cannot read property &#39;removeAttribute&#39; of null: Cant find source of it</a></li>
  <li><a href="https://stackoverflow.com/questions/21527922/cannot-read-property-0-of-null">Cannot read property *0* of null</a></li>
  </ol>
  
  <p>Few posts above are purely JS based so I believe is the reason they are not replying to me.</p>
  
  <p>I am using Selenium 3.0, Windows 7, Firefox, Chrome, Java, Testng</p>