-1

This is what i have. the out put i get is C./FAKE PATH/(value). I just want it to show the value not the C./FAKE PATH/.

$('#inputid').change(function(){
  var value =$(this).val();
alert(value);
})
Damien
  • 13
  • 3
  • 1
    Possible duplicate of [How to display selected file names before uploading multiple files in Struts2?](https://stackoverflow.com/questions/26082721/how-to-display-selected-file-names-before-uploading-multiple-files-in-struts2) – Laura Sep 17 '18 at 02:58

1 Answers1

0

You can use split('/').pop() to get anything after the last /.

E.G:

$('#inputid').change(function(){
    var value = $(this).val().split('/').pop();
    alert(value);
})
dustytrash
  • 1,568
  • 1
  • 10
  • 17