The first ( $('#<%=lblName.ClientID%>') ), the id selector, will find the element by its identifier. This is very fast since it will use native document.getElementById
Second, Attributes end with a selector , works differently. For example, in IE, it will get all the elements and a test identifier for each element if it ends with the provided value (or something similar). This is much slower. Newer browsers have querySelectorAll that will probably be used to find an element with this selector, but I'm not sure if it is supported by these functions (well, here it is defined as vailid css3, so suppose modern browsers will support ends with selector in querySelectorAll).
So in conclusion, the id selector should be faster anyway and much faster with older browsers. At the same time, using the selector, you can find an element without passing its client ID to the browser.
source share