var tab_attribs = $('li.tab_item').map(function () { return $(this).attr("custom_attribute"); });
This will give you an array of user attribute values. Of course, you can do this more traditionally:
var tab_attribs = []; $('li.tab_item').each(function () { tab_attribs.push( $(this).attr("custom_attribute") ); });
In any case, you should probably use the data-* attributes that HTML5 provides:
<li class="tab_item" data-foo="some custom data">
and (see jQuery data() ):
$('li.tab_item').data("foo"); // -> "some custom data"
source share