If we have just one element on which we have to apply css or javascript. What is more efficient giving it a class or id?. I understand that ideally we should be giving id but i have a scenario where i have an already written code and i want to change it only if there is a performance involved.
Share
check this blog post : http://www.stevesouders.com/blog/2009/06/18/simplifying-css-selectors/
Basically if your class is applied only on a few elements from the page, there will be no performance differences between id selector and class selector.