Search
 
SCRIPT & CODE EXAMPLE
 

HTML

how to use input type file and show selected file on screen

<input type="file" name="file" id="file" multiple 
       onchange="javascript:updateList()" />
<br/>Selected files:
<div id="fileList"></div>
Comment

how to use input type file and show selected file on screen

updateList = function() {
  var input = document.getElementById('file');
  var output = document.getElementById('fileList');

  output.innerHTML = '<ul>';
  for (var i = 0; i < input.files.length; ++i) {
    output.innerHTML += '<li>' + input.files.item(i).name + '</li>';
  }
  output.innerHTML += '</ul>';
}
Comment

PREVIOUS NEXT
Code Example
Html :: How to link Excel sheet to HTML page 
Html :: how to add user icon in html 
Html :: how to add bg color in html 
Html :: html open html in new tab as plain text 
Html :: Uncaught ReferenceError: Chartist is not defined 
Html :: engine html 
Html :: html web page examples with source code 
Css :: XAMPP: Another web server daemon is already running 
Css :: css second td in table 
Css :: no bullets in ul 
Css :: css rotate 90 deg 
Css :: css media queries between two sizes 
Css :: css image transform flip mirror 
Css :: css 100% -20px 
Css :: how to remove markers in css 
Css :: center div vertically tailwind 
Css :: responsive image in css 
Css :: 2 lines p css 
Css :: meyer-reset css cdn 
Css :: Centering a div of unknown height and width 
Css :: css flip svg 
Css :: grayscale css 
Css :: Failed to start ssh.service: Unit ssh.service not found. 
Css :: css set width of a span 
Css :: css change if mobile 
Css :: make images same size css 
Css :: scss sass watch command line 
Css :: cursor disabled 
Css :: css background image position vertical center 
Css :: remove all css styles from element 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =