<form method="post" enctype="multipart/form-data" action="">
<span id="filename">Select your file</span>
<label for="file-upload">Browse<input type="file" id="file-upload"></label>
</form>
<script>
$('#file-upload').change(function()
var filepath = this.value;
var m = filepath.match(/([^\/\\]+)$/);
var filename = m[1];
$('#filename').text(filename);
});
</script>
I just wanted help to implement the submit button such that each would not utilize the separate filename id that we are using here. I am new to js and have many file upload button in my project and when I am using classes every file name change is being reflected only on one button.