I need to return only the file name from an HTML input file.
The JavaScript code im using to get
You can try this
var path = document.getElementById("whatever").value; var fileName = path.match(/[^\/\\]+$/); console.log(fileName);