<style>
.button1{
color: #FF0000;
}
.button2{
color: #00FF00;
}
</style>
<input type="checkbox" id="chButton" />
<input type="button" value="My button" id="myButton" class="button1" />
<script>
var chBut = document.getElementById("chButton");
var but = document.getElementById("myButton");
chBut.onclick = function () {
but.className = this.checked ? "button2" : "button1";
};
</script>