<html> <header> <script src="prototype.js"></script> </header> <body> <input type="checkbox" id="che1" name="che" /> 1 <br /> <input type="checkbox" id="che2" name="che" /> 2 <br /> <input type="checkbox" id="che3" name="che" /> 3 <br /> <input type="checkbox" id="che4" name="che" /> 4 <br /> <input type="checkbox" id="che5" name="che" /> 5 <br /> <input type="button" value="Marcar" onclick="fnMarcar(true);" /> <br /> <input type="button" value="Desmarcar" onclick="fnMarcar(false);" /> <br /> <script type="text/javascript"> function fnMarcar(tipo){ $$('input').each(function(e){ if(e.type == 'checkbox' && e.name == 'che'){ e.checked = tipo; } }); } </script> </body> </html>