PhpRiot
Download This Article
Download this article or the entire “Eight Weeks of Prototype” series with all listings and files.




More information
Related Books
JavaScript: The Good Parts

JavaScript: The Good Parts

Most programming languages contain good and bad parts, but JavaScript has more than its share of...

ASP.NET AJAX in Action

ASP.NET AJAX in Action

Ajax has revolutionized the way users interact with web pages today. Gone are frustrating page...
Browse Articles
Ajax (4), APC (1), CAPTCHA (1), CSS (3), Debugging (1), File Upload (1), Google (3), Google Maps (2), JavaScript (12), JSON (2), MVC (1), MySQL (7), onbeforeunload (1), OOP (1), PHP (28), PhpDoc (1), PostgreSQL (6), Prototype (11), Reflection (1), RFC 1867 (1), Robots (1), Scriptaculous (1), SEO (1), Sessions (1), SimpleXML (1), Smarty (5), SOAP (1), SPL (1), Templates (2), W3C (1), XHTML (1), Zend Framework (1), Zend_Search_Lucene (1)

PhpRiot Newsletter
Your Email Address:

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.

In This Article


Tagged in ,