I need to fill in the empty spaces of the name of a file by selecting it with an <input type = "file">
using javascript or jQuery.
I tried like that, but it did not work
$(document).ready(function (e){
$('#file').on('change', function () {
var cadena = $('#file').val();
cadena= cadena.replace(/\s/g,"_");
document.getElementById('file').innerHTML = cadena;
}
}