Daemach wrote:
You should definitely consider using a classname to select items like this. $('input.quantity') would be significantly faster.
I don't know why using a class name would be significantly faster. Since there is no doucment.getElementsByClassName (yet), it doesn't make much difference to check for the class *attribute* or any other *attribute* - both are attributes. Maybe checking for a class is a bit more optimized because it is used more often. Have I overlooked something?
What makes it faster is using a type selector and context. -- Klaus