I have html tags like this:
<il class="currItem" data-sourcemp3="http://**"> <il class="currItem" data-sourcemp4="http://**">
And I want to get this data value, even if this mp3 or mp4 I wrote:
var A = $('.currItem').attr("data-source(.+)") console.log(A);
Or:
var srcName = new RegExp(/data-source.+/g); var A = $('.currItem').attr(srcName) console.log(A);
And I get "undefined"
How am i doing this? thanks in advance
source share