title: Insert value to input / JavaScript
body: <p>I have the following JS / HTML code:</p>
  
  <pre><code>&lt;input type="text" class="file" name="file_info" id="file_info"&gt;
      &lt;div class="file_upload"&gt;
          &lt;input type="file" id="file_upload" onchange="name();"&gt;
      &lt;/div&gt;
  &lt;script&gt;
      function name() {
          var fileName = document.getElementById("file_upload").value;
          var fnSplit = fileName.split(/[\/\\]/);
          fileName = fnSplit[fnSplit.length - 1];
        document.getElementById('file_info').innerHTML = 'Fred Flinstone';
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>I want that after I upload file, the file-name will shown in the tput text, but this cide doesn't work.</p>
  
  <p>How can I fix it?</p>
  
  <p><strong>Update : The file name should be inside the input text</strong></p>