Appendix C. Plugin Helpers

There are a few jQuery properties and actions that, although applying to any jQuery selection, are particularly useful for plugin development. The reason they’re hidden away in this appendix is that they’re not commonly used. Despite this, they’re quite powerful, and you should familiarize yourself with them if you intend to spend time developing plugins.

Selector and Context

The first ones we’ll look at are the selector and context properties. These work together to show you what jQuery thinks it’s working on. These are basically internal methods, but depending on what your plugin is doing, it can be good to know. The selector property returns a string value of the current jQuery selector string, so the command ...

Get jQuery: Novice to Ninja, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.