Problem about dragging and dropping images in jquery

Problem about dragging and dropping images in jquery

Hello everybody.
I'm trying to create my own drag and drop for images, I thought that I had understood the tutorials that I did but it seems I might not have gotten it. So I was hoping someone here could maybe tell me if I did understand or not.

This is my html code

  1. <div class="upload-console-drop" id="drop-zone"
  2.     just drag and drop files here
  3. </div>
This is my js

  1. $(document).ready(function(){
  2.     var dropZone = document.getElementById('drop-zone');

  3.     dropZone.ondrop = function(e){
  4.         e.preventDefault();
  5.         console.log(e);
  6.     }
  7. });
So from what I understood is that by doing e.preventDefault() you stop the image from opening up in the tab when you drag it over, but in my case it still opens up.

Am I missing something?
Thank's a lot!