Font Color Change

[Total: 0    Average: 0/5]

This example changes the font color on a click.

Head Code:

<script src="http://www.js-examples.com/bin/div_construct.js"></script>
<script>
var _msg='<font color=blue>SAMPLE TEXT<BR><a href="javascript:colorIt1()">Change font color to gold</a></font>';
//function NewDiv(window, id, body, left, top, width, height, zIndex, absolute) {
var _d = new NewDiv(window,"d0",_msg,0,0,300,300,1,"RELATIVE");
</script>

Body Code:

<script>
_d.output();
function colorIt1() {
  var _msg1='<font color=gold>SAMPLE TEXT<BR><a href="javascript:colorIt2()">Change font color to blue</a></font>';
  _d.setBody(_msg1);
}
function colorIt2() {
  var _msg1='<font color=blue>SAMPLE TEXT<BR><a href="javascript:colorIt1()">Change font color to gold</a></font>';
  _d.setBody(_msg1);
}
</script>

Times Viewed: 4

Leave a Reply

Your email address will not be published. Required fields are marked *