Setting DIV BG Color

[Total: 0    Average: 0/5]

This shows how to create a div and change it’s background color on user events.

Head Code:

<SCRIPT src="" type="text/javascript"></SCRIPT>
<script type="text/javascript">
var _x = "This is my Div<br>Look at it's color!"
var div1 = new NewDiv(window, "textpane", _x, 0, 0, 300, 20, 1, "");

Body Code:

<script type=text/javascript>
<a href="javascript:div1.setBgColor('#0000FF')">BLUE</a><BR>
<a href="javascript:div1.setBgColor('#FF0000')">RED</a><BR>
<a href="javascript:div1.setBgColor('#00FF00')">GREEN</a>

Times Viewed: 3

Leave a Reply

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