_x000D_
//----------App.js---------------------//_x000D_
$(document).ready(function() {_x000D_
var holder = document.getElementById('holder');_x000D_
holder.ondragover = function () { this.className = 'hover'; return false; };_x000D_
holder.ondrop = function (e) {_x000D_
this.className = 'hidden';_x000D_
e.preventDefault();_x000D_
var file = e.dataTransfer.files[0];_x000D_
var reader = new FileReader();_x000D_
reader.onload = function (event) {_x000D_
document.getElementById('image_droped').className='visible'_x000D_
$('#image_droped').attr('src', event.target.result);_x000D_
}_x000D_
reader.readAsDataURL(file);_x000D_
};_x000D_
});
_x000D_
.holder_default {_x000D_
width:500px; _x000D_
height:150px; _x000D_
border: 3px dashed #ccc;_x000D_
}_x000D_
_x000D_
#holder.hover { _x000D_
width:400px; _x000D_
height:150px; _x000D_
border: 3px dashed #0c0 !important; _x000D_
}_x000D_
_x000D_
.hidden {_x000D_
visibility: hidden;_x000D_
}_x000D_
_x000D_
.visible {_x000D_
visibility: visible;_x000D_
}
_x000D_
<!DOCTYPE html>_x000D_
_x000D_
<html>_x000D_
<head>_x000D_
<title> HTML 5 </title>_x000D_
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.js"></script>_x000D_
</head>_x000D_
<body>_x000D_
<form method="post" action="http://example.com/">_x000D_
<div id="holder" style="" id="holder" class="holder_default">_x000D_
<img src="" id="image_droped" width="200" style="border: 3px dashed #7A97FC;" class=" hidden"/>_x000D_
</div>_x000D_
</form>_x000D_
</body>_x000D_
</html>
_x000D_