Mindblown: a blog about philosophy.

  • Conclusion

    In this lesson we’ve gone beyond the art of selecting elements and started manipulating their attributes and properties. In these pages you discovered the differences between attributes and properties and how you can operate on them using jQuery. In addition, you learned how to perform basic tasks—for example, forcing external links to be opened in…

  • Storing custom data on elements

    Let’s just come right out and say it: global variables suck. Except for the infrequent, truly global values, it’s hard to imagine a worse place to store information that you’ll need while defining and implementing the complex behavior of your pages. Not only do you run into scope issues, but they also don’t scale well…

  • Manipulating element properties

    As with the attr() method, to get and set a value of a property in jQuery you can use a similar approach: the prop() method. attr() and prop() are similar in their capabilities and in the parameters they accept. Besides, for those of you who like anecdotes, the prop() method was extracted from attr() as a way to reorganize the latter and to let it focus solely…

  • Removing attributes

    In order to remove attributes from DOM elements, jQuery provides the removeAttr() method. Its syntax is as follows. Method syntax: removeAttr removeAttr(name) Removes the specified attribute or attributes from every matched element Parameters name (String) The name of the attribute or list of attributes’ names separated by a space to remove Returns The jQuery collection Let’s see…

  • Working with attributes

    In this section we’ll delve into the world of attributes and the methods jQuery offers to work with them. Fetching attribute values In jQuery, to get and set a value of an attribute you can use the attr() method. This is a typical peculiarity of jQuery. As you’ll often see, the same method can be used either…

  • Defining element properties and attributes

    When it comes to DOM elements, some of the most basic components you can manipulate are the properties and the attributes assigned to those elements. These properties and attributes are initially assigned to the JavaScript object instances that represent the DOM elements as a result of parsing the HTML markup, and they can be changed…

  • Working with properties, attributes, and data

    This lesson covers Everyone who has approached software development for the first time has learned a very important lesson: even huge and complex software consists of a mix of elementary instructions. Summing numbers, counting items, and iterating over elements are just a few examples of these basic operations. In the same way, you can create…

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

Got any book recommendations?