Code 1
jQuery("ul#leftmenuacc").find("span.leftmenutextspan")[0].css('color', 'red');
The above code doesn't work, so I had to do it another way [ below mentioned ]
Code 2
jQuery("ul#leftmenuacc").find('span.leftmenutextspan').each(function(index){ if(index ==0) jQuery(this).css('color', 'red') });
I am confused here as why didn't the Code 1 works? I read the documentation on .css from Jquery Docs, but couldn't find what I am missing.
Is there an elegant way to do it? Because currently I am iterating through a lot of DOM Items for no use.
ul#leftmenuacc