Working with IDs and Classes with the Behaviour JavaScript Library
(Page 1 of 4 )
Do you want to learn how to quickly build web sites that separate visual presentation and structural markup from JavaScript code? Then you should try the powerful Behaviour package! Welcome to the second article of the series that began with "Introducing the Behaviour JavaScript Library." In a step-by-step format, this series shows you how to use the capacity offered by this software to get rid of those ugly, old-fashioned inline JavaScript routines.
Introduction
Stepping back for a moment to the topics that I covered in the preceding article, certainly you'll recall that in that tutorial I showed you how to utilize the neat features incorporated in the Behaviour library. They came in handy for assigning diverse functions to specific CSS selectors, without the need to deal with embedded JavaScript code.
In consonance with this concept, I provided you with a decent set of hands-on examples, which demonstrated how to assign basic JavaScript functions to simple web page elements, such as paragraphs and links.
However, beyond the educational sense that I originally planned to give to the referenced examples, the objective of this series is to explore the wide range of possibilities that this excellent software package can offer to many web developers. As we examine these possibilities, we'll keep in mind that the trend to write independent behavior layers has grown in popularity in the last few months.
Therefore, since I assume that you're interested in learning more about the capacities that come bundled with Behaviour, in this second part of the series I'm going to show you how to use it to work with more complex CSS selectors, this time including IDs and classes.
Having established the goal of this tutorial, let's continue exploring the numerous capacities of this JavaScript library. Let's get started!
Next: Extending the use of CSS selectors with the Behaviour library >>
More JavaScript Articles
More By Alejandro Gervasio