<script> function f1() { var c = document.getElementById("b1").style.color; if (c === 'blue') { c = 'green'; } else { c = 'blue' } document.getElementById("b1").style.color = c; } </script>
Click me to change text color