I need to return only the file name from the input HTML file.
<input type="file" id="whatever" />
The JavaScript code used to get the file name:
document.getElementById("whatever").value;
In firefox, it gives only the file name that I want, but in IE I get the full path.
I think string manipulation is the only way to get the name.
What would be the easiest / shortest way to get just a name (extension too) in JavaScript? Thanks.
source share