javascript browse folder path-limit 1

javascript browse folder path-limit

Here is what the above code is Doing:
1. The element is set to accept multiple files.
2. The onchange event is set to call the selectFolder() function.
3. The webkitdirectory, mozdirectory, msdirectory, odirectory, and directory attributes are set to allow the user to select a folder.
4. The multiple attribute is set to allow the user to select multiple files.
5. The selectFolder() function gets the files from the input element and then gets the first file’s relative path.
6. The relative path is split into an array using the “/” character as the separator.
7. The first element in the array is the folder name.
8. The folder name is displayed in an alert box.

Similar Posts