You are previewing jQuery: Novice to Ninja, 2nd Edition.

jQuery: Novice to Ninja, 2nd Edition

Cover of jQuery: Novice to Ninja, 2nd Edition by Craig Sharkie... Published by SitePoint

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 ...

The best content for your career. Discover unlimited learning on demand for around $1/day.