Mindblown: a blog about philosophy.

  • 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…

  • Conclusion

    This lesson focused on creating and adjusting sets of elements (referred to in this lesson and beyond as a jQuery collection or set of matched elements) via the many means that jQuery provides for identifying elements on an HTML page. jQuery provides a versatile and powerful set of selectors, patterned after the selectors of CSS, for identifying elements…

  • Testing your skills with some exercises

    In this section you’ll practice doing some exercises targeting the selectors and the filters described in this lesson. If you want to test your solutions, you can run them using the jQuery Selectors Lab Page. In addition, we’ll provide you our solutions to allow you to compare them with yours. Exercises Here’s the list of…

  • Enhancing performances using context

    Up to this point, we’ve been acting as if there were only one argument that we can pass to jQuery’s $() function, but this was just a bit of hand waving to keep things simple at the start. In lesson 1 we briefly introduced a second parameter called context. It’s used to restrict the selection to one or more subtrees…

  • Introducing filters

    Filters are selectors that usually work with other types of selectors to reduce a set of matched elements. You can recognize them easily because they always start with a colon (:). Just as you’ve seen for the attributes, if another selector isn’t specified, the use of the Universal selector is implicitly assumed. One of the peculiarities…

  • Selecting elements using attributes

    Attribute selectors are extremely powerful and allow you to select elements based on their attributes. You can easily recognize these selectors because they’re wrapped with square brackets (for example, [selector]). To see them in action, let’s take another look at a portion of the lab page: What usually makes the link pointing to an external site unique…

  • Retrieving elements by their hierarchy

    Retrieving a set of elements by their class name is a nice feature, but often you don’t want to search the whole page. Sometimes you may want to select only the direct children of a certain element. Consider the following HTML fragment from the sample DOM in the Selectors Lab: Suppose that you wanted to…

  • Basic selectors

    For applying styles to page elements, web developers have become familiar with a small but useful group of selection expressions that work across all browsers. Those expressions can select by an element’s ID, by CSS class names, and by tag names. A special case of selecting elements by tag name is the Universal selector, which…

Got any book recommendations?