Menu
I’m trying to add a function to a php web video script that I’m using.
I’m looking for help with .each(). I don’t know much javascript code, but am looking for how to complete this function with the correct each()
[CODE]
function countTotalCredits() {
var checked = [];
$(“button[data-action=’multiple_select_button][data-selected=1]”).closest(“.video-wrapper”).each(function(i){
if ($(this).attr(‘data-selected’) == 1) {
checked.push($(this).attr(‘data-price’));
}
});
return checked;
}
any suggestions/guidance will be appreciated.