Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>File MIME checker test</title>
</head>
<body>
<input type="file" id="file1">
  <p>MIME type: <span id="mime1"></span>
    <p>Dummy submit: <input type="submit" id="submit1">
  <p><img id="img1" style="max-width: 50%; max-height: 50%;">
<script>
  file1 = document.getElementById('file1');
  img1 = document.getElementById('img1');
  mime1 = document.getElementById('mime1');
  file1.addEventListener('change', function() {
    mime1.innerHTML = file1.files[0].type;
    img1.src = file1.files[0].getAsDataURL();
  }, false);
</script>
</body>
</html>
 
if (document.getElementById('hello')) {
  document.getElementById('hello').innerHTML = 'Hello World - this was inserted using JavaScript';
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers