Category: Operating on a jQuery collection
-
Conclusion
This lesson described how to create and augment a set of matched elements using HTML fragments to create new elements on the fly. These orphaned elements can be manipulated, along with any other elements in the set, and eventually attached to parts of the page document. A set of methods to adjust the set in…
-
Even more ways to use a set
There are still a few more tricks that jQuery has up its sleeve to let you refine your collections of objects. Another method that we’ll examine allows you to test a set to verify if it contains at least one element that matches a given selector expression. The is() method returns true if at least one element matches the…
-
Honing the contents of a set
You saw that it’s a simple matter to augment a jQuery object from multiple selectors chained together with the add() method. It’s also possible to chain selectors together to form an except relationship by employing the not() method. This is similar to the :not filter selector we discussed in the previous lesson, but it can be employed in a similar fashion to the add() method…
-
Managing the jQuery collection
Once you have a jQuery set, whether identified from existing DOM elements with selectors or created as new elements using HTML snippets (or a combination of both), you’re ready to manipulate those elements using the powerful set of jQuery methods. We’ll start looking at those methods in the next lesson, but what if you want…
-
Generating new HTML
On many occasions, you’ll want to generate new fragments of HTML to insert into a page. Such dynamic elements could be as simple as extra text you want to display or as complicated as creating a table of database results you’ve obtained from a server. A typical situation where this feature comes in handy is…
-
Operating on a jQuery collection
This lesson covers In this lesson you’ll discover how to create new DOM elements using the highly flexibile jQuery() function. The need to create new elements will occur frequently in your practice with the library. You’ll find yourself using this capability especially when we start discussing how to inject external data into a web page using JSON…