Javascript Q
Javascript Q
- Started
- Last post
- 4 Responses
- BusterBoy
I've got a function that is called from within Flash that can change the bgcolor of a page.
<script language="JavaScript">
<!-- function changeBgColor(newBgColor) { if (window.document && window.document.bgColor) { document.bgColor = newBgColor; } } -->
</script>WOuld anyone know how to modify this so it will change the bgcolor of a DIV instead of the whole page?
- acescence0
document.getElementById("mydiv... = newBgColor;
- acescence0
dammit
document .getElementById ( "mydiv" ) .style .backgroundColor = newBgColor;
- BusterBoy0
Thanks mate, worked a treat.
One quick one...could this be modified to change the background image of a page, not just the colour?
- acescence0
document .body .style .backgroundImage = "url(image.jpg)";