更新时间:2023-02-20 08:28:07
尝试一下,
Live Demo
$('video source').each(function(num,val){
console.log($(this).attr('src')); // i am not getting this..
$(this).attr('src', 'newSourceValue')
});
根据OP的评论,更改src文件名
Based on the comments by OP, changing the src filename
Live Demo
$('video source').each(function(num,val){
console.log($(this).attr('src')); // i am not getting this..
strSrc = $(this).attr('src');
strPath = strSrc.substring(0, strSrc.lastIndexOf('/'));
strExtenion = strSrc.substring(strSrc.lastIndexOf('.'));
$(this).attr('src', strPath + "/" + "newFileName" + strExtenion );
});