0

I was wondering how can I get the value from the selected file. I am using

document.getElementById("file1").click()

so is it fine to use like this :

var v = document.getElementById("file1").click();
Ousmane D.
  • 50,173
  • 8
  • 66
  • 103
  • 2
    [HTMLElement.click()](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click) doesn't return anything. So your `v` will be `undefined`. Are you looking for something like this? https://stackoverflow.com/a/29176118/1647737 – le_m May 26 '17 at 23:41
  • If you are trying to get the value of a file input(???) [Can't get value of input type=“file”?](https://stackoverflow.com/questions/5903323/cant-get-value-of-input-type-file) – Thomas Wikman May 26 '17 at 23:44
  • @ThomasWikman thanks but how can i get the output file? i am trying to get an image so i can manipulate it with thresholding – Hanane Evancho May 27 '17 at 00:04
  • All i can do is direct you to a resource with lots of examples of what you can achieve with JavasScript and "Files". I hope you find it usefull. https://www.html5rocks.com/en/tutorials/file/dndfiles/ Time for me to say godnight. – Thomas Wikman May 27 '17 at 00:10
  • @ThomasWikman thanks alot and have good day – Hanane Evancho May 27 '17 at 00:16

0 Answers0