Things to do in Cape Town, the Helderberg, and the Cape Winelands

Tag first element

Getting the First Object Returned by a jQuery Selector

If for instance you have just used a jQuery selector to grab a whole lot of objects and now realize that in actual fact you only want to effect the first object that the selector returned to you, you can rest easy in the knowledge that jQuery as per usual has you covered.

© 2021 An Exploring South African — Powered by WordPress