In this recipe, we'll see how to use one style declaration phrase to alter any group of selected elements.
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.
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 on a Group"/> <input id="go_div" type="button" value="Set Authors Apart"/> </form> <br/> <div>Every great man nowadays has his disciples, and it is always Judas who writes the biography...