Eight Weeks of Prototype: Week 2, How Prototype Extends Elements
Summary
In this article we have looked at some of the ways that Prototype extends each DOM element to give you greater control in your programming. We learned that these extensions are applied automatically when an element is retrieved using one of the element selection methods that was covered in the first article of this series (namely, $(), $$() and Element.select()).
I firstly showed you how to update and read the content of elements, as well as how to read and write attributes of elements and when it might be useful to do so.
Next I showed you how to manage an element's class names, as well as how to read and write an element's styles in real-time.
Finally, I showed you how to hide and show DOM elements using the simple methods made available by Prototype.
In the next article of this series, I will teach you about the different data types available when using Prototype, such as Enumerable, Array and Hash.
- Download a PDF version of this article
- View or post comments for this article
- Browse similar articles by tag: JavaScript, Prototype
-
Read related articles:
- Eight Weeks of Prototype: Week 1, Beginning with Prototype
- Eight Weeks of Prototype: Week 3, Prototype Data Types
- Eight Weeks of Prototype: Week 4, Event Handling in Prototype
- Eight Weeks of Prototype: Week 5, Ajax with Prototype
- Eight Weeks of Prototype: Week 6, Writing JavaScript Classes with Prototype
- Eight Weeks of Prototype: Week 7, Other Prototype Functionality
- Eight Weeks of Prototype: Week 8, A Complete Prototype Example


