how to get individual classes for each menu list items I am theming my website and used the following code to print my main menu. 

&lt;?php
 $main_menu = variable_get('menu_main_links_source', 'main-menu');
 $tree = menu_tree($main_menu);
 print render($tree);
?&gt;


Now, I need to have individual class name of each list item, so that I can call different background images using css. I would like to have class with name 'menu-497' as shown in screenshot. I couldn't figure out how this is done. Please help. 
Old code which used to load individual list class is below. But this code won't load submenu, so I am not using it. 

&lt;?php print theme('links__system_main_menu', array(
  'links' =&gt; $main_menu,
  'attributes' =&gt; array(
    'id' =&gt; 'topNav',
  ),
)); ?&gt;
It looks like you need Menu attributes module:


  You should use this module when
  
  
  You want to "nofollow" certain menu items to sculpt the flow of PageRank through your site
  You want to give a menu item an ID so you can easily select it using jQuery
  You want to add additional classes or styles to a menu item
  


Alternatively, if you don't mind some coding, see theme_menu_link(). Comments in it's documentation already shows how to do it:


   function superseven_menu_link(array $variables) {
     $variables['element']['#attributes']['class'][] = 'menu-' . $variables['element']['#original_link']['mlid'];

     return theme_menu_link($variables);
   }