Collections of HTML elements may be handled as a group.
A favorite trick is to turn the option elements of a select on and off. Using various collections of elements, this is a snap in MooTools.
Use ID attributes to affect unique elements: $('my_single_target')
, and use class attributes to affect groups of elements: $$('.my_target_class')
.
<script type="text/javascript" src="mootools-1.3.0.js"></script> </head> <body> <form action="javascript:" method="get"> Choose an Animal:<br/> <select id="animal"> <option value="">Select Animal</option> <option value="cat">Cat</option> <option value="dog">Dog</option> <option value="pig">Pig</option> </select> // some browsers do not fire select onchange // until focus changes <input type="button" value="Select Animal"/> <br/><br/> <select id="animal_items"...