title: JavaScriptexecutor setAttribute value on selenium
body: <p>I was executing a selenium automation on IE11. Now for an Element, say ele; <code>ele.sendKeys(characters)</code> are not working directly. So I was trying to change the 'value' attribute for that <code>&lt;input&gt;</code> tag through JavaScript Executor. Once I change that, I am verifying the same by <code>ele.getAttribute('value')</code>. But that time I am getting that the value is still null like earlier. And My test is also failing for the same.</p>
  
  <p><strong>HTML code</strong></p>
  
  <pre><code>&lt;form id="upload" method="post" action="/upload" enctype="multipart/form-data" style="width: 90%"&gt;
  &lt;label for="uploadinputFile"&gt;
  &lt;br style="clear:all"&gt;
  &lt;input id="browse_file" class="bttn-primary" type="button" value="Browse"&gt;
  &lt;input id="file_input_browser" type="file" name="upload_File"&gt;
  &lt;div id="button"&gt;
  &lt;input id="submit" class="bttn-primary" type="submit" disabled="" value="Upload"&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>Selenium Code</strong></p>
  
  <pre><code>WebElement brw=driver.findElement(By.id("file_input_browser"));
  ((JavascriptExecutor) driver).executeScript("document.getElementById('file_input_browser').setAttribute('value', 'new value for element')");
  System.out.println("value:"+brw.getAttribute("value"));
  </code></pre>
  
  <p>I have also used following JavaScriptExecutor:
   <code>((JavascriptExecutor) driver).executeScript("arguments[0].setAttribute('value', '" +c+"')",brw);</code>//c is a String</p>
  
  <p>But Everytime I am getting output for <code>brw.getAttribute("value")</code> as blank/null</p>