jQuery element[attribute=something] vs element.class performance
问题 I am wondering which way would end up being faster, selecting elements by: $('element[href=#my_link]'); or: $('element.my_class'); I don't like repeating myself when I write code, so I prefer to write it the first way for the most part because then I can add information to it like: <a href="#delete_1">Delete</a> $('a[href^=#delete]'); and then split it up so that I have all of the information that I need once it is clicked, or whatever the action may be. Am I sacrificing overall performance