title: File Upload Using Javascript returns 'Access Denied' Error With Stylized <input type='file' > to a button
body: <p>I have stylized My File input using :</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;style&gt;
  #yourBtn{
   position: relative;
   top: 150px;
   font-family: calibri;
   width: 150px;
   padding: 10px;
   border-radius: 5px;
   border: 1px dashed #ddeeff; 
   text-align: center;
   background-color: #ffddee;
   cursor:pointer;
   color:#333333;
  }
  &lt;/style&gt;
  &lt;script type="text/javascript"&gt;
   function getFile(){
  document.getElementById("upfile").click();
   }
   function sub(obj){
   document.getElementById("yourBtn").innerHTML = "Uploading Please Wait...";
   document.myForm.submit();
   event.preventDefault();
   }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;center&gt;
  &lt;form action="/sub/upload.php" method="POST" enctype="multipart/form-data" name="myForm" target="myiframe"&gt;
  &lt;div id="yourBtn" onclick="getFile()"&gt;click to upload a file&lt;/div&gt;
  &lt;div style='height: 0px;width: 0px; overflow:hidden;'&gt;&lt;input id="upfile" type="file" name="upload" style="display:none;" onchange="sub(this)" /&gt;&lt;/div&gt;
  &lt;/form&gt;
  &lt;iframe name="myiframe" style="width:100;height:100;border:2px solid #bbccdd;"&gt;&lt;/iframe&gt;
  &lt;/center&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The Problem is .submit() function returns the ' Access Denied ' error on IE (tested in IE8 and 9). Works fine in all other browsers (chrome,opera,safari and Firefox). when the sub(obj) is invoked. And The same is happening even if i use Jquery also.</p>
  
  <p>So Can any one tell me how should i get this script working on IE ?</p>