O'Reilly logo

MooTools 1.3 Cookbook by Jay Larry G. Johnston

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Styling the borders of a group of elements

In this recipe, we'll see how to use one style declaration phrase to alter any group of selected elements.

Getting ready

When a group of elements must have borders, we can style them all with just one call. Just as we apply styles to a single element through the Element.setStyle() and Element.setStyles() methods, our groups of elements can be styled just as easily.

How to do it...

This example demonstrates the changing of a single property with setStyle() as well as the changing of multiple style properties with the setStyles() method.

<script type="text/javascript" src="mootools-1.3.0.js"></script> </head> <body> <form action="javascript:" method="get"> <input id="go_bold" type="button" value="Set Borders ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required