$('#dynamicformdata').each(function() {
// "this" in the first function refers to the div
console.log(this);
// call a second function for every source tag in every video in the dynamicformdata tag
$('video>source', this).each(function() {
// "this" referes to a source tag
console.log(this.type);
});
});
Если вы хотите получить все типы в виде массива:
$('#dynamicformdata').each(function() {
var types = [];
$('video>source', this).each(function() {
types.push(this.type);
});
// logs the div element and all found types (duplicates not filtered out)
console.log(this, types);
});