I have some javascript that I am using for some audio on my website:
<script type="text/javascript">
$(function() {
var a = audiojs.createAll({
trackEnded: function() {
var next = $("ul li.cow").next();
if (!next.length) next = $("ul li").first();
next.addClass("cow").siblings().removeClass("cow");
audio.load($("a", next).attr("duck"));
audio.play();
}
});
var audio = a[0];
first = $("ul a").attr("duck");
$("ul li").first().addClass("cow");
audio.load(first);
$("ul li").click(function(e) {
e.preventDefault();
$(this).addClass("cow").siblings().removeClass("cow");
audio.load($('a', this).attr('duck'));
audio.play();
});
});
</script>
What I’d like to do is add “.mp3” after the attribute “duck”…how do I do that? *Attribute “duck” appears three times and I would like to add the extension “.mp3” after all three 🙂
Thanks,
Josh
I guess you’re asking about simple string addition? Then just add
after each attr(‘duck’)