var array = [];
$('.inner-menu > span').each(function(){
array.push({
object: $(this),
name: $(this).text(),
sub: $(this).data('sub'),
pnd: $(this).data('pnd'),
otd: $(this).data('otd'),
});
});
console.log(array);
При выполнении, в переменной array будет подобный массив объектов:
[{"name":"Текст","sub":1,"pnd":2,"otd":3},{"name":"Текст","sub":1,"pnd":2,"otd":3},{"name":"Текст","sub":1,"pnd":2,"otd":3},{"name":"Текст","sub":1,"pnd":2,"otd":3},{"name":"Текст","sub":1,"pnd":2,"otd":3},{"name":"Текст","sub":1,"pnd":2,"otd":3},{"name":"Текст","sub":1,"pnd":2,"otd":3},{"name":"Текст","sub":1,"pnd":2,"otd":3}]