I have this jQuery .each function so I can traverse all the UL hmtl tags. Then I will get there id attribute. But the problems is, How can I get each value and place it to another variable so I can use it to .sortable UI function. Here is my code:
jQuery('.b ul').each(function(){
jQuery(this).attr('id');
});
example: the output of the .each function when I do alert is “0 1 2”. How can I place it to another variable? So it would be use in:
jQuery(variable here).sortable(){ });
The code above will get the ID attribute. Anyone who can help?
Thanks,
Justin
No need to use the ID’s at all. You can provide jQuery’s
$()function with more than just ID’s:Or if you are using multiple libraries (jQuery, MooTools, etc.):