5 tips for more efficient jQuery selectors at sitepoint

The people at Sitepoint just posted this great post about writing more efficient jQuery selectors. Very useful if you don’t know a lot about code and you are starting to use jquery in your environment. Their post is not about SharePoint, but the tips can be used in your SharePoint jQuery code.

Their 5 tips:
– Use and ID if possible (not that easy with the terribly long ID’s in SharePoint)
– Avoid selecting by class only
– Keep it simple
– Increase specifity from left to right
– Avoid selector repetition

About: Marijn

Marijn Somers (MVP) has over 14 years experience in the SharePoint world, starting out with SP2007. Over the years the focus has grown to Office 365, with a focus on collaboration and document management. He is a business consultant at Balestra and Principal Content Provider for "Mijn 365 Coach" that offers dutch employee video training. His main work tracks are around user adoption, training and coaching and governance. He is also not afraid to dig deeper in the technicalities with PowerShell, adaptive cards or custom formatting in lists and libraries. You can listen to him on the biweekly "Office 365 Distilled" podcast.