我正在使用<input type="file" id="myfile">
并且上面有文件格式。JQuery传递第一个“。”字符的文件名并返回文件名称值
例如mytestfile1.imagefile.jpg
或mytestfile2.documentfile.docx
什么,我试图做的是获取文件的名称,例如:
mytestfile1.imagefile
或mytestfile2.documentfile
现在我的代码是这样的:
alert($('#myfile').val().split('.').shift());
但我只有mytestfile1
或mytestfile2