I am trying to make a simple downloader where users drag and drop files from the desktop to a website element. I believe that I understood how, but I cannot get any information about the file. How can I set the value of input files from drag and drop? Here is the drag and drop code im im not sure if it is correct. The box does change color when it is outlined on top of it.
$(".droparea").bind({
dragleave: function (e) {
e.preventDefault();
$(".droparea").css("backgroundColor","white");
},
drop: function (e) {
e.preventDefault();
},
dragenter: function (e) {
e.preventDefault();
$(".droparea").css("backgroundColor","Green");
},
dragover: function (e) {
e.preventDefault();
}
});
source
share